We're updating the issue view to help you get more done. 

The ElasticSearch plugin silently drops exceptions and returns wrong results on improper fieldType

Description

As outlined in http://www.collectiveaccess.org/support/forum/index.php?p=/discussion/298134/boolean-searches-type-safety-in-es

we get incorrect results on some searches in ES (ok on SqlSearch), and by all appearances it could be a type-related issue. Example:

ca_sets.set_code:tstset
5 results (correct)

ca_sets.set_code:tstset OR ca_sets.set_id:tstset (or any other non-number string)
No results (incorrect)

ca_sets.set_code:tstset OR ca_sets.set_id:3992 (or any other number)
5 results (correct)

Note that ca_sets.set_code OR ca_sets.set_id is the expansion of the set access_point in the standard search_indexing.conf (and thus the standard set access_point fails).

In fact ES throws an error NumberFormatException[For input string: "tstset"] but the catch in app/lib/core/Plugins/SearchEngine/ElasticSearch.php (L.372) swallows it up and silently returns the empty return set, a big no-no as the user is not aware of any issues and gets the wrong results (the query might very well have results).

Environment

ElasticSearch

Assignee

User known

Reporter

yelto

Labels

None

Components

Affects versions

Priority

Major
Configure