Skip to content

Commit

Permalink
Stemming: Redirect exact search to field 'xy.exact'
Browse files Browse the repository at this point in the history
CustomESRequestSerializer
  • Loading branch information
ksuess committed Apr 3, 2022
1 parent ffbef7b commit 593835e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/Searchkit/CustomESRequestSerializer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,25 @@ export class CustomESRequestSerializer {
},
};
});
// quote_field_suffix: '.exact',
// quote_field_suffix
// This tells Elasticsearch that the words that appear in between quotes are to be redirected to a different field
// https://www.elastic.co/guide/en/elasticsearch/reference/current/mixing-exact-search-with-stemming.html
// The field xy.exact must be available. See
// "title": {
// "type": "text",
// "analyzer": "german_analyzer",
// "fields": {
// "exact": {
// "type": "text",
// "analyzer": "german_exact_analyzer"
// }
// }
// },
shouldList.push({
query_string: {
query: qs,
fields: simpleFields,
quote_field_suffix: '.exact',
},
});
bodyParams['query'] = {
Expand Down

0 comments on commit 593835e

Please sign in to comment.