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

Odd parenthesis use confuses... something. #269

Closed
jrbl opened this issue Apr 30, 2014 · 14 comments
Closed

Odd parenthesis use confuses... something. #269

jrbl opened this issue Apr 30, 2014 · 14 comments

Comments

@jrbl
Copy link
Member

jrbl commented Apr 30, 2014

Originally on 2010-08-31

find (t supergravity or result ) and t quark

Note that space after 'result'. Without it, the search works. Which means it gives no results. But with that space, then it complains that there are mismatched parentheses and breaks.

This is the behavior in my #131 version of search_engine_query_parser.

But the version of seqp in master breaks just as much, and regardless of whether there's a space.

Annette noticed that (on -prod):
fin (a hawking) gives nothing
fin (a hawking or ellis) breaks too (only 3 results)
... but fin (a hawking or a ellis) looks OK

So there's something fascinatingly bizarre going on.

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2010-09-05

A simpler query is (ellis ), which breaks in Invenio syntax.

This is not in the query parser; if you call Parser.parse_query('(ellis )') it produces exactly the right output. So the problem is somewhere else in the stack, probably in search_engine.py.

I haven't yet checked whether the other paren related breakages that Annette noticed are in the parser or not.

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2010-09-05

Annette's other examples also work when you call Parser.parse_query(query_string), so this is also being broken somewhere else in the stack.

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2010-09-15

Also note from the user tests with Lance Dixon:

He found it natural to use syntax like author:dixon -(collaboration:D0) title:QCD which is sort of odd, but I understand his motivation... anyway the point is that this failed, due to the parens in inspirebeta. I did not check that this worked in tislxn1

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2010-10-06

New version pushed per conversation on inspire-dev. Branch name is 296-WebSearch_SPIRES_parser_uses_ISO_dates.

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2010-11-16

Some searches are fixed, but some are still giving problems. Notably:

  1. fin (a hawking)
  2. (ellis )
  3. author:dixon -(collaboration:D0) title:QCD

cases 1 and 3 are essentially similar and I think the problem is in search_engine.py in search_pattern() somewhere.

case 2 is just weird.

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2011-03-07

Valkyrie, I'm hoping that the work you've been doing recently with parenthesized parser will negate the need for this, in which case I invite you to worksforme it and move on. This is also not very high priority, but would be a natural follow-on to finishing the SQPP plugin.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-03-22

The cases with (a hawking ) etc., were failing due to the empty string between hawking and ) being expanded as a part of the name. I added some scrubbers that will remove these unnecessary spaces and also made the author name regexp a little smarter. This is available in branch 269-parentheses_quirks on my public AFS repo at SLAC.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-03-22

I am setting this back to fail because the UI still captures the searches incorrectly; this will be resolved with ticket #453 when everything is directed through the parenthesised parser. The unit tests for these cases now pass, but the integration step will be necessary for the changes to be visible to users.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-03-23

Additional info on this:

The SPIRES part parses correctly into (author:hawking) but there is a special case currently in search_engine that prevents search terms inside parentheses that do not contain spaces (this special case is for search terms like U(1) and SL(2,Z)) from going through the parenthesised parser. I will be working on sending all terms through the parenthesised parser in the future, since it correctly parses this.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-03-30

This was fixed alongside ticket #453 and is available on github as branch 269-453-495-direct_through_parend_parser. See notes on ticket #453 about elegance, etc.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-03-31

Now in AFS

@jrbl
Copy link
Member Author

jrbl commented Apr 30, 2014

Originally on 2011-05-31

Held up by inclusion of #534; Tibor to merge base commit and time #534, and then we can discuss any ongoing issues there.

@invenio-developers
Copy link

Originally by valkyrie (@valkyriesavage) on 2011-07-07

269-453-parend_parser_improvements

--- see ticket #453

@jirikuncar
Copy link
Member

It works well for Invenio queries.

In [1]: from invenio.modules.search.api import SearchEngine

In [2]: s = SearchEngine('author:dixon -(collaboration:D0) title:QCD')

In [3]: s.query
Out[3]: AndOp(AndOp(KeywordOp(Keyword('author'), Value('dixon')), NotOp(KeywordOp(Keyword('collaboration'), Value('D0')))), KeywordOp(Keyword('title'), Value('QCD')))

In [4]: s = SearchEngine('(ellis )')

In [5]: s.query
Out[5]: ValueQuery(Value('ellis'))

Please re-open in Invenio-Query-Parser repo if you can reproduce the problem.

jmartinm pushed a commit to jmartinm/invenio that referenced this issue Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants