[CSHARP-3097] How to cleanly deal with full text search and sort by score when search term is an empty string? Created: 08/May/20 Updated: 18/May/20 Resolved: 18/May/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Michael Fyffe | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Hello,
We are implementing full text search in our application and ran into a couple of situations that seemed less than ideal. Mainly when dealing with the possibility of the user entering in an empty string for the search string and trying to sort by score.
I was hoping i could do something like this to dynamically compose the pipeline.
What i noticed is that the sort filter was not getting added as a pipeline stage.
2. There is no concept of an Empty Sort Definition like Filters so i couldn't sort by score which is ideal
In the end i pretty much ended up doing this. It works and does make sense but at the downside of duplicating parts of the query.
I would love some feedback if there is a cleaner alternative way of doing the above.
Thanks!
|
| Comments |
| Comment by Esha Bhargava [ 18/May/20 ] |
|
Thanks for your report. Please note that this project is for reporting bugs or feature suggestions for the driver. For MongoDB-related support discussion please post on the MongoDB Community Forums. A question like this involving more discussion would be best posted on the MongoDB community. |