Mohan_T
(Mohan T)
February 20, 2024, 8:20pm
1
Query
{
"query": {
"bool": {
"should": [
{
"match": {
"keywords.keyword_values": {
"query": "prayer room",
"operator": "AND"
}
}
}
],
"minimum_should_match": "1"
}
}
}
Doc 1
"keywords": [
{
"keyword_values": "room"
},
{
"keyword_values": "prayer"
}
}
Doc 2
"keywords": [
{
"keyword_values": "room prayer"
}
}
Doc 3
"keywords": [
{
"keyword_values": "prayer room"
}
}
I want to fetch only Doc 2 & Doc 3 not Doc 1, the above query is fetching all 3 Docs
RabBit_BR
(andre.coelho)
February 20, 2024, 8:27pm
2
Please do not duplicate questions.
to find the exact match
mappings
"keywords": {
"type": "object",
"enabled": True,
"properties": {
"keyword_values": {
"type": "text",
"analyzer": "synonym_stemmer_bad_words_analyzer",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
Doc 1
"keywords": [
{
"keyword_values": "marbles"
},
{
"keyword_values": "flooring"
}
}
Doc 2
…
To fetch the exact match I have applied
Ex: keywords.keyword_values.keyword
mappings:
"keywords": {
"type": "object",
"enabled": True,
"properties": {
"keyword_values": {
"type": "text",
"analyzer": "synonym_stemmer_bad_words_analyzer",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
keywords.keyword_values.keyword exact match if am applying, stemmer is not…
Mohan_T
(Mohan T)
February 20, 2024, 8:32pm
3
I have updated the question
system
(system)
Closed
March 19, 2024, 8:32pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.