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

field validation fails for regex queries #1

Open
joelb-git opened this issue Sep 30, 2013 · 1 comment
Open

field validation fails for regex queries #1

joelb-git opened this issue Sep 30, 2013 · 1 comment
Labels

Comments

@joelb-git
Copy link
Owner

This works fine:

$ ./lqt -i ~/.m2/repository/bt/coref/tac-2012-kb-seeded-index-22/LOCATION_ORGANIZATION_PERSON \
-q bad-field-name:value
Exception in thread "main" java.lang.RuntimeException: Invalid field names: [bad-field-name]
    at com.basistech.gcoref.utils.LuceneQueryTool.runQuery(LuceneQueryTool.java:313)
    at com.basistech.gcoref.utils.LuceneQueryTool.run(LuceneQueryTool.java:245)
    at com.basistech.gcoref.utils.LuceneQueryTool.main(LuceneQueryTool.java:597)

But this does not:

$ ./lqt -i ~/.m2/repository/bt/coref/tac-2012-kb-seeded-index-22/LOCATION_ORGANIZATION_PERSON \
-q bad-field-name:/value/
# no exception

I think this is because query.extractTerms() returns no terms when the
underlying query is regex. One possible solution is to detect this and
then try to parse out the field name ourselves. That could be tricky,
e.g. if --default-field is used, or if there are multiple boolean
clauses in the query, on different fields, etc.

@joelb-git
Copy link
Owner Author

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

No branches or pull requests

1 participant