Skip to content

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

@IgorRodchenkov

Description

@IgorRodchenkov

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions