-
Notifications
You must be signed in to change notification settings - Fork 33
wildcard search #154
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
Comments
Is this a wildcard on a single specified field or a wildcard on all fields. |
This issue seems related to #199. |
What about something like this added to the POST search object:
Adding something like this Another alternative is we keep the existing calls as they are, simple and without any wild card or match method, and peruse a |
What about simply supporting regex searches? Are there any cases we would'nt be able to deal with? |
yes, Regex is definitely a valid option, though in most cases I would caution against it for performance reasons. In general, regex in SQL is very slow. So if we did want to support regex, I would still want to add an explicit flag in the request to indicate to the server that it should use a REGEXP query. That way, if regex was not explicitly requested, the server could use a much faster version of the search query. |
Following this morning discussion, I propose a slightly different approach. Instead of replacing a simple text search with a regexp search in the specs, how about adding a (GET or POST) parameter called "operator" that would be by default set to a simple text search and implementation that supports other type of operators would provide the list somewhere (to dig... serverinfo? calls call?).
So, for instance, if you want to find all germplasm which name begins with "pisang", it could be managed by |
I am thinking about something even simpler. I think just a simple wildcard character would solve >80% of the use cases. We are thinking about really flexible and powerful tools to cover many imaginary scenarios, but there are simple, real, problem scenarios right now that aren't getting solved.
wildCardCharacter default is "" and that indicates an exact match That should cover "beginsWith", "endsWith", "contains", and "exact" matches. Easy to add to the spec, easy to implement in most systems, and it is somewhat extendable later if we find a real need for more complex text matching. |
Fair enough. :) Question: how to choose between case sensitive and case insensitive match? And it does solve the problem for text values but NOT when you want to filter attribute (numeric) values that are above, below or between some other value(s)... :-s [edit]...and I'm quite sure there should be also a filter needed for dates somewhere! |
The general consensus in the hackathon discussion was to keep the specification simple until there was a concrete use case that couldn't be solved with the existing filters. In this case @jframi is dealing with millions of germplasm and needing to search by name. It is not practical to download a larger set and filter client side. I believe it was a similar situation that opened this issue originally. To answer your questions more directly: I would leave it up to the server implementation to decide if they are using case sensitivity or not. Until it becomes an issue, then we can discuss adding to the spec. Regarding numbers and dates, the
If the need arises, we can add these types of search fields for simple number and date filtering. |
General consensus at BrAPI Hackathon 2024 was :
|
thanks, backslash escape character isn't displayed though |
Wild card : "*" |
would be useful for germplasm and studies
The text was updated successfully, but these errors were encountered: