adsabs / montysolr

Solr for Astrophysics Data System
https://ui.adsabs.harvard.edu
Other
50 stars 18 forks source link

Bug: pos(aff:(A B), 1) does not work #125

Open aaccomazzi opened 5 years ago

aaccomazzi commented 5 years ago

Use case: we want to find all papers with first author affiliations containing both "Max" (has in Max-Plank) and "Astronomy" (as in "Institute for Astronomy").

This search returns the expected results: aff:"^max" aff:"^astronomy"

And so does this one: pos(aff:"max", 1) pos(aff:"astronomy", 1)

This one, however, doesn't: pos(aff:("max" "astronomy"), 1)

The last query should be functionally equivalent to the previous two.

JCRPaquin commented 8 months ago

aff:("max" "astronomy") expands to aff:"max" aff:"astronomy". pos(aff:("max" "astronomy"), 1) expands to pos(spanNear(aff:max aff:astronomy, 1), 1)

aff:"max astronomy" does not expand to spanNear(aff:max aff:astronomy) aff(max NEAR astronomy) expands to spanNear(aff:max aff:astronomy, 5)