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

Improve search client api: make Lucene syntax escaping optional, etc. #12

Open
IgorRodchenkov opened this issue Dec 1, 2017 · 0 comments
Assignees

Comments

@IgorRodchenkov
Copy link
Member

We've talked about app-ui search issues and PathwayCommons/app-ui#272 with @d2fong, @maxkfranz, @jvwong and realised the following.

Let's get rid of the (obsolete, forgotten) toggle Lucene escape feature but keep (and fix) the escape Lucene function - and create three different full-text search functions in this PC client library:

  • phraseSearch(q) - would submit the input string q to the web service (literally, using double quotes around it, or, alternatively, submit as *Q*, where Q is escaped/sanitised input phrase);
  • luceneSearch(q) - would not touch the query string (Lucene query expression) besides applying standard url-encoding (in case of HTTP GET request); and we in fact want this one in app-ui (which analyses user input and builds more relevant Lucene expressions internally);
  • keywordSearch(q) - would split 'q' into tokens (by \s+) - "a", "b", "c",..; escape each (sanitises); then, call luceneSearch("*a* OR *b* OR *c*...")...

Also, keywordSearch and phraseSearch could have optional parameters, such as index 'field' (prefix) and 'exact' (true/false) to specifically search as, e.g., phraseSearch("q","name", false) would be equivalent to wildcard search in 'name' index: luceneSearch("name:*Q*"), where Q is escaped q.

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

No branches or pull requests

1 participant