Elasticsearch Stopwords are not working and /_analyze giving correct response











up vote
0
down vote

favorite












I am using elastic search 6.5.x and I added multiple under custom analyzer. When it comes to stopword analyzer, I am able to get the response correctly when I check with _analyze, When comes to the reality on my index the search box giving me the results even the stopwords are entered. I am posting my index,mapping any Solution for this.



Index:



PUT some-index
{
"settings": {
"index": {
"number_of_shards": 4,
"number_of_replicas": 1,
"refresh_interval": "60s",

"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_snow", "my_stop","my_synonym"]
}
},
"filter" : {
"my_snow" : {
"type" : "snowball",
"language": "English"

},
"my_stop": {
"type":"stop",
"stopwords_path":"/home/elasticsearch-6.5.0/config/stopwords/stopwords.txt"
},
"my_synonym" : {
"type" : "synonym",
"synonyms_path" : "/home/elasticsearch-6.5.0/config//analysis/synonyms.txt"
}
}}
}
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
"properties": {
"title": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"content": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"url": {
"type": "keyword",
"index": "false",
"store": true
},
"host": {
"type": "keyword",
"index": "true",
"store": true
},
"seed": {
"type": "keyword",
"index": "true",
"store": true
}

}}
}
}


Query I need to use



POST /some-index/_search
{
"query": {
"bool" : {
"must" : {
"query_string" : {
"query" : "test" /* Tested with and,between*/
}
},
"filter" : {
"term" : { "seed" : "ghi" }
}
}
}
}


Tested with /_analyze Works great



POST some-index/_analyze
{
"analyzer": "my_analyzer",
"text":"Hi this is Ramy."
}









share|improve this question






















  • hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
    – Kamal
    2 days ago










  • Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
    – an__snatcher
    2 days ago















up vote
0
down vote

favorite












I am using elastic search 6.5.x and I added multiple under custom analyzer. When it comes to stopword analyzer, I am able to get the response correctly when I check with _analyze, When comes to the reality on my index the search box giving me the results even the stopwords are entered. I am posting my index,mapping any Solution for this.



Index:



PUT some-index
{
"settings": {
"index": {
"number_of_shards": 4,
"number_of_replicas": 1,
"refresh_interval": "60s",

"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_snow", "my_stop","my_synonym"]
}
},
"filter" : {
"my_snow" : {
"type" : "snowball",
"language": "English"

},
"my_stop": {
"type":"stop",
"stopwords_path":"/home/elasticsearch-6.5.0/config/stopwords/stopwords.txt"
},
"my_synonym" : {
"type" : "synonym",
"synonyms_path" : "/home/elasticsearch-6.5.0/config//analysis/synonyms.txt"
}
}}
}
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
"properties": {
"title": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"content": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"url": {
"type": "keyword",
"index": "false",
"store": true
},
"host": {
"type": "keyword",
"index": "true",
"store": true
},
"seed": {
"type": "keyword",
"index": "true",
"store": true
}

}}
}
}


Query I need to use



POST /some-index/_search
{
"query": {
"bool" : {
"must" : {
"query_string" : {
"query" : "test" /* Tested with and,between*/
}
},
"filter" : {
"term" : { "seed" : "ghi" }
}
}
}
}


Tested with /_analyze Works great



POST some-index/_analyze
{
"analyzer": "my_analyzer",
"text":"Hi this is Ramy."
}









share|improve this question






















  • hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
    – Kamal
    2 days ago










  • Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
    – an__snatcher
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using elastic search 6.5.x and I added multiple under custom analyzer. When it comes to stopword analyzer, I am able to get the response correctly when I check with _analyze, When comes to the reality on my index the search box giving me the results even the stopwords are entered. I am posting my index,mapping any Solution for this.



Index:



PUT some-index
{
"settings": {
"index": {
"number_of_shards": 4,
"number_of_replicas": 1,
"refresh_interval": "60s",

"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_snow", "my_stop","my_synonym"]
}
},
"filter" : {
"my_snow" : {
"type" : "snowball",
"language": "English"

},
"my_stop": {
"type":"stop",
"stopwords_path":"/home/elasticsearch-6.5.0/config/stopwords/stopwords.txt"
},
"my_synonym" : {
"type" : "synonym",
"synonyms_path" : "/home/elasticsearch-6.5.0/config//analysis/synonyms.txt"
}
}}
}
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
"properties": {
"title": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"content": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"url": {
"type": "keyword",
"index": "false",
"store": true
},
"host": {
"type": "keyword",
"index": "true",
"store": true
},
"seed": {
"type": "keyword",
"index": "true",
"store": true
}

}}
}
}


Query I need to use



POST /some-index/_search
{
"query": {
"bool" : {
"must" : {
"query_string" : {
"query" : "test" /* Tested with and,between*/
}
},
"filter" : {
"term" : { "seed" : "ghi" }
}
}
}
}


Tested with /_analyze Works great



POST some-index/_analyze
{
"analyzer": "my_analyzer",
"text":"Hi this is Ramy."
}









share|improve this question













I am using elastic search 6.5.x and I added multiple under custom analyzer. When it comes to stopword analyzer, I am able to get the response correctly when I check with _analyze, When comes to the reality on my index the search box giving me the results even the stopwords are entered. I am posting my index,mapping any Solution for this.



Index:



PUT some-index
{
"settings": {
"index": {
"number_of_shards": 4,
"number_of_replicas": 1,
"refresh_interval": "60s",

"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_snow", "my_stop","my_synonym"]
}
},
"filter" : {
"my_snow" : {
"type" : "snowball",
"language": "English"

},
"my_stop": {
"type":"stop",
"stopwords_path":"/home/elasticsearch-6.5.0/config/stopwords/stopwords.txt"
},
"my_synonym" : {
"type" : "synonym",
"synonyms_path" : "/home/elasticsearch-6.5.0/config//analysis/synonyms.txt"
}
}}
}
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
"properties": {
"title": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"content": {
"type": "text",
"index": "true",
"store": true,
"analyzer": "my_analyzer"
},
"url": {
"type": "keyword",
"index": "false",
"store": true
},
"host": {
"type": "keyword",
"index": "true",
"store": true
},
"seed": {
"type": "keyword",
"index": "true",
"store": true
}

}}
}
}


Query I need to use



POST /some-index/_search
{
"query": {
"bool" : {
"must" : {
"query_string" : {
"query" : "test" /* Tested with and,between*/
}
},
"filter" : {
"term" : { "seed" : "ghi" }
}
}
}
}


Tested with /_analyze Works great



POST some-index/_analyze
{
"analyzer": "my_analyzer",
"text":"Hi this is Ramy."
}






elasticsearch






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 at 21:25









an__snatcher

488




488












  • hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
    – Kamal
    2 days ago










  • Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
    – an__snatcher
    2 days ago


















  • hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
    – Kamal
    2 days ago










  • Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
    – an__snatcher
    2 days ago
















hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
– Kamal
2 days ago




hey @an__snatcher, could you let me know how many servers are being used, did you reboot all the servers after adding the *.txt files in all of them? I've tried query at my end and it works as expected. Could you also post a sample document which you think shouldn't be showing up but yet shows up in the response.
– Kamal
2 days ago












Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
– an__snatcher
2 days ago




Hi @Kamal. If the server means an Elastic Server then I am using one server and Do I need to reboot this server before indexing the data or else after pushing the data into the index. I am sharing some sample data Title: About Storm Crawler Content: StormCrawler is an open source SDK for building distributed web crawlers based on Apache Storm. The project is under Apache license v2 and consists of a collection of reusable resources and components, written mostly in Java. url: http://stormcrawler.net/ host: www.stormcrawler.net seed: stormcrawler
– an__snatcher
2 days ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345607%2felasticsearch-stopwords-are-not-working-and-analyze-giving-correct-response%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345607%2felasticsearch-stopwords-are-not-working-and-analyze-giving-correct-response%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out