vanng822 / go-solr

Solr client in Go, core admin, add docs, update, delete, search and more
MIT License
69 stars 42 forks source link

Add option for Realtime Get #54

Closed arrpee closed 4 years ago

arrpee commented 4 years ago

From the docs:

The realtime get feature allows retrieval (by unique-key) of the latest version of any documents without the associated cost of reopening a searcher. This is primarily useful when using Solr as a NoSQL data store and not just a search index.

A query might be:

query := solr.NewQuery()
query.Q("id:123")
s := si.Search(query)
res, err := s.Result(nil)

while a similar get request is:

q := NewQuery()
q.AddParam("id", "123")
s := si.Search(q)
res, err := s.RealTimeGet(nil)

Any thoughts?

vanng822 commented 4 years ago

Thanks