-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add "hits total" value to search result #1227
Comments
This is an interesting request, thanks for bringing it up. We don't have a standard interface yet for returning metadata about the search. This a little tricky to us being locked in to "table" results with Postgres, where ES can return a nested key-value object. Could you give me an example query of how you would like this to work? |
For example, we have these searches:
The result would be a total of 487 posts. It would be easiest if you could just insert the value into the output when you need it, similar to "paradedb.rank_bm25(id)". For example: paradedb.found(). Then the counter is always displayed in the column, but I don't need a second query.
Additional metadata would be ideal of course, but for now this simple solution with a field like "paradedb.found()" is enough for me. |
What other metadata would you like to see? |
For example, the total search time. But as I said, the number of results found is enough for me :-) |
What
During a search, there is always a hit counter with the number of records found. Even if you use limit or offset. This hit counter does not yet exist for "pg_search".
Why
To display the number of hits found despite the limit or offset without having to do a second query. Otherwise, this will cost performance.
How
Add the count value as a field value so that it can be retrieved if needed. By default, Elasticsearch returns the number of documents found in the response to a search query. This value is located under the hits.total.value key. We also need this value for pg_search. In any form.
The text was updated successfully, but these errors were encountered: