[SERVER-13532] Provide highlighting of results from full text search Created: 09/Apr/14 Updated: 22/Mar/23 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | Text Search |
| Affects Version/s: | None |
| Fix Version/s: | features we're not sure of |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Christian Amor Kvalheim | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 7 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Query Integration
|
||||
| Participants: | |||||
| Description |
|
Currently there is no way to know what text in a document matched the query. 2.4 did include the field queryDebugString but that is also gone in 2.6. I think it's worthwhile to look at how elastic search provides this functionality. The motivation is any search view that contains documents (think pubmed or other scientific search engines) This should preferably be an option |
| Comments |
| Comment by Ravi Teja Garlapati [ 08/Feb/21 ] | |||||||
|
Until there is official solution, a solution that may work work, is to use projection condition. Projection could look something like this (assuming documents containing field1, field2, both of which are added to text index):
This projection filter only applies on documents after main query filter is applied. So, performance should be fine. One could also remove stop words from <your search string split into array> (depending on your text index language), so that the result more accurately matches what the text index has done. |