Answer the question
In order to leave comments, you need to log in
How to create snippets in delta indexes?
Good afternoon.
I'm trying to implement delta indexes in my application.
The original config was:
index search_content {
# config
}
SELECT * FROM search_content WHERE MATCH('@(header, body) "test"');
index search_content {
# config
}
index search_content_delta : search_content {
# config
}
SELECT * FROM search_content, search_content_delta WHERE MATCH('@(header, body) "test"');
index search_content_main {
# config
}
index search_content_delta : search_content_main {
# config
}
index search_content {
local = search_content_main
local = search_content_delta
}
SELECT * FROM search_content WHERE MATCH('@(header, body) "test"');
[1064] The distributed index for snippets must have exactly one local agent [ CALL SNIPPETS(('test string text'), 'search_content', 'test' ,'<b>' as `before_match`,'</b>' as `after_match`)]
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Snippets work a little differently than you imagine. The index is necessary to you only what to take morphology of processing of lines. You pass the strings themselves to the CALL SNIPPETS function. So it will be enough for you to use only the main index to get the morphology.
Example from the docs:
CALL SNIPPETS('this is my document text', 'test1', 'hello world')
The documentation says:
"It could be a single string, or the list of the strings enclosed in curly brackets. index is the name of the index from which to take the text processing settings. query is the full-text query to build snippets for."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question