5

When querying Amazon Cloudsearch using the exact content of a field as the query, Cloudsearch returns no results, if the query (and content) contains a stopword. If I remove the stopword from the query, then results are returned.

I understand that stopwords are removed from content when indexing for performance, but I would have thought they would also be ignored in queries to prevent this behavior.

To allow the verbose user to get expected results, will I need to filter out the stopwords from the query for every language, or is there a way for Cloudsearch to ignore stopwords in the query itself?

Index field content:

The Company Search Test

Example queries

With stopword:

Query: the company search test
Results: NONE

Without stopword:

Query: company search test
Results: YES

Inside quotes:

Query: "the company search test"
Results: YES

Implementation details for this example:

  • index field type: "text"
  • index field analysis scheme: "English"
  • all options selected for field: "Return", "Sort", "Highlight"
  • QueryParser: "simple"
  • using test search in AWS dashboard (same results if using Go sdk)
Feckmore
  • 4,322
  • 6
  • 43
  • 51
  • Hi. I'm experiencing the same problem. Did you manage to fix this? Thx – carlosvini Jun 15 '16 at 14:42
  • Moved on to some other problems, but will be coming back to this... so no clear solution yet. – Feckmore Jun 16 '16 at 22:16
  • 1
    Thx. In my case it was caused by some fields not using the same Analysis Scheme, and so not having the same Stopwords. When searching only by a specific field it worked, but searching all the fields (without saying which) did not work – carlosvini Jun 16 '16 at 22:26
  • @carlosvini, it looks like the solution may be simply specifying "OR" as the default operator when querying. Still seems to be a bug with the "AND" as default operator. – Feckmore Jul 29 '16 at 18:59
  • 1
    I had this problem too, but in my case, I was setting the query options search fields to include all text, text-array, literal, and literal-array fields. By removing the literal/literal-array fields, from the fields to search on, I got the expected set of results. – Matt Feb 08 '18 at 18:30

0 Answers0