Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in position search with inst: field #192

Open
ehenneken opened this issue Oct 13, 2022 · 1 comment · Fixed by #201
Open

Error in position search with inst: field #192

ehenneken opened this issue Oct 13, 2022 · 1 comment · Fixed by #201

Comments

@ehenneken
Copy link
Member

The query pos(inst:GSFC, 1) throws the following exception

Illegal state: combining multiple fields is not allowed: Message with key:Illegal state: combining multiple fields is not allowed and locale: en_US not found.
@drgillis
Copy link

drgillis commented Nov 1, 2022

The problem here is the use of the inst search field rather than the institution field. The query pos(institution:GSFC, 1) returns the expected results successfully.

The direct issue is that the pos operator attempts to extract a single field from its first argument.
This operator uses the org.apache.lucene.queryparser.flexible.aqp.builders.AqpAdsabsSubQueryProvider#getField method which fails on boolean queries (i.e. queries with multiple clauses joined with boolean operators) with more than one unique field.

The inst field is defined as a "virtual" field; it is used to simultaneously search both the aff_id and institution fields. Internally, these virtual fields seem to get processed into boolean OR-clauses. Since inst has multiple fields, pos throws a syntax error when it is used as the first argument.

The documentation on positional field searches mentions that pos only allows the first argument to use the author, aff, and title fields (which is not complete since institution works as well). However, this page should probably explicitly mention that virtual fields are not allowed. Additionally, the error message reported by ADS could be improved.

If desired, the pos operator could be modified to work with boolean clauses by applying the pos operator to each clause and then joining those queries with the appropriate boolean operators. For example, pos(inst:X, n) could then be transformed into pos(institution:X) OR pos(aff_id:X).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants