Opened 15 years ago

Last modified 5 months ago

#414 assigned defect

QueryParser corner cases

Reported by: Olly Betts Owned by: Olly Betts
Priority: normal Milestone: 2.0.0
Component: QueryParser Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description (last modified by Olly Betts)

There are quite a few cases which we probably don't handle as well as we could (sometimes it's not totally clear what the behaviour should be), so let's make a list here and see if we can find resolutions, or decide the current behaviour is fine.

With FLAG_SYNONYM this causes reparsing so parse as foo abc def (we just ignore ~ unless the next character is a word character, so without the "foo:" prefix, ~ is just ignored):

~foo:(abc def)

Assuming "foo" is set as a non-boolean prefix, it should probably parse as synonyms for the two terms, so the same as:

~foo:abc ~foo:def

Change History (9)

comment:1 by Olly Betts, 14 years ago

Milestone: 1.2.x

comment:2 by Olly Betts, 13 years ago

Milestone: 1.2.x1.3.x

comment:3 by Olly Betts, 11 years ago

Description: modified (diff)

comment:4 by Olly Betts, 9 years ago

Milestone: 1.3.x1.4.x

Not a release blocker - we can fix these in 1.4.x without an ABI break.

comment:5 by Olly Betts, 20 months ago

Milestone: 1.4.x2.0.0

comment:6 by Olly Betts, 15 months ago

I wonder if we should require whitespace around operators (or a parenthesis is OK - e.g. a AND(b OR c)AND d should parse with 3 operators) but currently some punctuation is treated like a space here, but parentheses don't work:

$ quest 'foo=AND=bar'
Parsed Query: Query((foo@1 AND Zbar@2))
No database specified so not running the query.
$ quest 'a AND(b OR c)AND d'
Parsed Query: Query((Za@1 OR and@2 OR (Zb@3 OR Zc@5) OR Zd@7))
No database specified so not running the query.

comment:7 by Olly Betts, 15 months ago

(tested those last cases with 1.4.22 and git master)

comment:8 by Olly Betts, 10 months ago

Milestone: 2.0.01.5.0
Status: newassigned

~foo:"abc def" [...] should probably do a multi-word synonym expansion.

I actually have a patch which implements this part so we can easily do this part for 1.5.0.

Last edited 5 months ago by Olly Betts (previous) (diff)

in reply to:  8 comment:9 by Olly Betts, 5 months ago

Description: modified (diff)
Milestone: 1.5.02.0.0

Replying to Olly Betts:

~foo:"abc def" [...] should probably do a multi-word synonym expansion.

I actually have a patch which implements this part so we can easily do this part for 1.5.0.

Applied in 8c723ec78753e9ae701261eb388ef4b7855aff5e. The other case probably isn't for 1.5.0.

Note: See TracTickets for help on using tickets.