You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a simple dfs query with es but for some reason the highlighting doesn't work. What am I doing wrong?
Here's an except the Domain that's searched:
class Story {
static searchable = {
only = ['author', 'creationDate', 'publishDate', 'owners', 'id', 'name', 'summary', 'text', 'category']
author reference:true
owners reference:true
category reference:true
root true
}
...
This is the search call and the highlight settings:
def highlighter = {
field 'text'
field 'summary'
field 'author.name'
preTags '<mark>'
postTags '</mark>'
}
def txtSrchResult = Story.search(searchType: 'dfs_query_and_fetch', highlight: highlighter, from: params.offset, size: params.max, sort: params.sort, order: params.order) {
bool {
if(searchTerm?.length() > 0) {
must {
query_string(query: searchTerm)
}
}
if(! isAdmin) {
must {
term(deleted: false)
}
must {
term(previouslyApproved: true)
}
}
if(checkids != null) {
must {
ids(values: checkids)
}
}
}
}
The search itself works fine, I get the results I'm looking for. The "highlight" list is also returned, but it doesn't contain any fragments whatsoever. None of the fields is ever present in the maps, even though the hit is definitely in the text and/or summary.
What am I missing here?
The text was updated successfully, but these errors were encountered:
I'm using a simple dfs query with es but for some reason the highlighting doesn't work. What am I doing wrong?
Here's an except the Domain that's searched:
This is the search call and the highlight settings:
The search itself works fine, I get the results I'm looking for. The "highlight" list is also returned, but it doesn't contain any fragments whatsoever. None of the fields is ever present in the maps, even though the hit is definitely in the text and/or summary.
What am I missing here?
The text was updated successfully, but these errors were encountered: