Stop words not working


(pandurangarao) #1

I am new to elasticsearch, I am trying to index the with stop words write the query for similarity score but normal and stop words queries are giving same result bellow is my code:

PUT /myindex25
{
"settings": {
"similarity": {
"default": {
"type": "default"
}
}
}
}

PUT /myindex25/question/11
{
"stemtext": "elastic search for marvel question type voluptatum",
"correctoptiontext": "the option data for question1"
}

GET /myindex25/question/_search
{
"query": {
"match": {
"stemtext": {
"query":"elastic"
}
}
}
}


With stopwords

PUT /my_index
{
"settings": {
"analysis": {
"filter": {
"my_stop": {
"type": "stop",
"stopwords": ["the", "elastic" ]
}
}
}
}
}

PUT /myindexstopword25/question/11
{
"stemtext": "elastic search for marvel question type voluptatum",
"correctoptiontext": "the option data for question1"
}

GET /myindexstopword25/question/_search
{
"query": {
"match": {
"question.stemtext": {
"query":"elastic"
}
}
}
}

any one can please help what is wrong in stop words query.

my expected results is without stop words query I need to get the score and with stop words query, document should not be match as because elastic search is in stop words list


(system) #2