Skip to content
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

DocIDQuery - How to query a single document by DocID #74

Open
prabhatsharma opened this issue Sep 19, 2021 · 1 comment
Open

DocIDQuery - How to query a single document by DocID #74

prabhatsharma opened this issue Sep 19, 2021 · 1 comment

Comments

@prabhatsharma
Copy link

Bleve used to have a DocIDQuery, Is that not built on purpose in bluge. What is the recommendation for querying a specific document by DocID?

@mschoch
Copy link
Member

mschoch commented Sep 22, 2021

So, in Bluge we removed the DocIDQuery because we want to emphasize that there isn't really anything special about the _id field. It is just a field in which all values are unique. To search for a document using it's identifier, you should simply create a term query for the ID, and scope it to only search the _id field.

Background: The top-level Bluge API makes it easy to create documents, all which have a field named _id, and we do this because it works well for many use cases. However, the internals of Bluge were designed to not assume/require this field. Also, one of the design constraints of Bluge was to have a smaller API surface area where possible (avoid multiple ways to do the same thing). Given both of these, it made sense to me to remove it. In summary I would say that we want Bluge developers to not think of ID's as special, and instead think of them like just another field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants