|
I'm trying to figure out why the following fuzzy lucene search isn't working. If I search for {
"query": {
"bool": {
"should": [
{
"match": {
"Content.ContentItem.FullText": {
"query": {{ searchTerm | json | raw }},
"fuzziness": "2"
}
}
},
{
"match": {
"TitlePart^2": {
"query": {{ searchTerm | json | raw }},
"fuzziness": "2"
}
}
},
{
"match": {
"Content.ContentItem.DisplayText.Normalized^2": {
"query": {{ searchTerm | json | raw }},
"fuzziness": "2"
}
}
}
],
"minimum_should_match": 1,
"filter": {
"term": { "Content.ContentItem.Published": "true" }
}
}
},
"sort": {
"PublishedUtc": {
"order": "desc",
"type": "double"
}
}
}I'm using OC |
Answered by
devlife
Mar 31, 2023
Replies: 2 comments 1 reply
|
Use that same Query with Elasticsearch to see if it works I would say. Then we will know if there is an issue. But the FuzzyQueryProvider is there, maybe it is not doing what you need though. The best way to know is to debug it. |
1 reply
|
My issue is that I am just not very familiar with the json search syntax. I managed to figure it out but my head is still spinning! {
"query": {
"bool": {
"should": [
{
"match": {
"Content.ContentItem.FullText": {
"query": {{ searchTerm | json | raw }},
"fuzziness": 2,
"operator": "or"
}
}
},
{
"match": {
"TitlePart^2": {
"query": {{ searchTerm | json | raw }},
"fuzziness": 2,
"operator": "or"
}
}
},
{
"match": {
"Content.ContentItem.DisplayText.Normalized^2": {
"query": {{ searchTerm | json | raw }},
"fuzziness": 2,
"operator": "or"
}
}
}
],
"minimum_should_match": 1,
"filter": {
"term": { "Content.ContentItem.Published": "true" }
}
}
},
"sort": {
"PublishedUtc": {
"order": "desc",
"type": "double"
}
}
} |
0 replies
Answer selected by
devlife
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My issue is that I am just not very familiar with the json search syntax. I managed to figure it out but my head is still spinning!
I think I'm going to switch to using the C# api :)
{ "query": { "bool": { "should": [ { "match": { "Content.ContentItem.FullText": { "query": {{ searchTerm | json | raw }}, "fuzziness": 2, "operator": "or" } } }, { "match": { "TitlePart^2": { "query": {{ searchTerm | json | raw }}, "fuzziness": 2, "operator": "or" } …