Hi everybody, i'have issues using stemmer,
following the guidelines at link
https://www.elastic.co/guide/en/elasticsearch/reference/6.7/mixing-exact-search-with-stemming.html
I created the following index (partial mapping for body limitations)
{
"settings":{
"analysis":{
"analyzer":{
"italian_exact":{
"tokenizer":"standard",
"filter":[
"lowercase"
]
},
"space_analyzer":{
"type":"custom",
"tokenizer":"keyword",
"char_filter":[
],
"filter":[
"whitespace_normalization",
"trim"
]
}
},
"filter":{
"whitespace_normalization":{
"type":"pattern_replace",
"pattern":"\s+",
"replacement":" "
}
}
}
},
"mappings":{
"news":{
"properties":{
"timestamp":{
"type":"date",
"format":"strict_date_optional_time||epoch_millis"
},
"bodyText":{
"type":"text",
"analyzer":"italian",
"fields":{
"exact":{
"type":"text",
"analyzer":"italian_exact"
},
"raw":{
"type":"keyword",
"ignore_above":256
},
"title":{
"type":"text",
"analyzer":"italian",
"fields":{
"exact":{
"type":"text",
"analyzer":"italian_exact"
},
"raw":{
"type":"keyword",
"ignore_above":256
}
}
}
}
}
}
}
}
}
(i'm refreshin' our old queries so I'm trying not to completely deconstruct them) it seems the difference between exact or not don't exists.
{
"size": 100,
"from": 0,
"query": {
"bool": {
"must": {
"query_string": {
"query": "fisco", {/* Or ""fisco"" when i search exact */}
"fields": [
"title"
],
"quote_field_suffix": ".exact"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"timestamp": {
"lt": "2019-04-08T23:59:59"
}
}
},
{
"term": {
"isFirst": true
}
}
],
"must_not": [
{
"exists": {
"field": "Previgenza"
}
}
]
}
}
}
},
"sort": {
"datejs": {
"order": "desc"
}
},
"highlight": {
"pre_tags": [
"< strong>< em>"
],
"post_tags": [
" "
]
}
}
But the result returned is the same.
I think the error is in the search query, but I could have set the index wrong too...
anyone can help me?
thank you in advance!
Sorry, it seems the stemmer is working, but seems don't find the root of some words (italian)
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.