Note that there are some explanatory texts on larger screens.

plurals
  1. POElasticSearch: strange search behaviour when using snowball analyzer
    primarykey
    data
    text
    <p>So let's say I have an ElasticSearch index defined like this:</p> <pre><code>curl -XPUT 'http://localhost:9200/test' -d '{ "mappings": { "example": { "properties": { "text": { "type": "string", "analyzer": "snowball" } } } } }' curl -XPUT 'http://localhost:9200/test/example/1' -d '{ "text": "foo bar organization" }' </code></pre> <p>When I search for "foo organizations" with snowball analyzer, both keywords match as expected:</p> <pre><code>curl -XGET http://localhost:9200/test/example/_search -d '{ "query": { "text": { "_all": { "query": "foo organizations", "analyzer": "snowball" } } }, "highlight": { "fields": { "text": {} } } }' { "took": 1, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.015912745, "hits": [ { "_index": "test", "_type": "example", "_id": "1", "_score": 0.015912745, "_source": { "text": "foo bar organization" }, "highlight": { "text": [ "&lt;em&gt;foo&lt;/em&gt; bar &lt;em&gt;organization&lt;/em&gt;" ] } } ] } } </code></pre> <p>But when I search for only "organizations" I don't get any result at all which is very weird:</p> <pre><code>curl -XGET http://localhost:9200/test/example/_search -d '{ "query": { "text": { "_all": { "query": "organizations", "analyzer": "snowball" } } }, "highlight": { "fields": { "text": {} } } }' { "took": 1, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 0, "max_score": null, "hits": [] } } </code></pre> <p>However, if I search for "bars" it still hits:</p> <pre><code>curl -XGET http://localhost:9200/test/example/_search -d '{ "query": { "text": { "_all": { "query": "bars", "analyzer": "snowball" } } }, "highlight": { "fields": { "text": {} } } }' { "took": 1, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.10848885, "hits": [ { "_index": "test", "_type": "example", "_id": "1", "_score": 0.10848885, "_source": { "text": "foo bar organization" }, "highlight": { "text": [ "foo &lt;em&gt;bar&lt;/em&gt; organization" ] } } ] } } </code></pre> <p>I guess the difference between "bar" and "organization" is that "organization" is stemmed to "organ" while "bar" is stemmed to itself. But how do I get the proper behaviour so that 2nd search hits?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload