简体   繁体   中英

Solr search query using rest API

My requirement is to send a search query to the Solr server through a Rest API and retrieve results.

Is there a facility to send search queries using a Rest API?

If the non-rest query is field1:name1 , what should the body of the JSON would be? (assuming there exist such a facility in Solr)

Depending on what you mean by "through a Rest API", all queries are by default submitted through a standard HTTP query interface. Query /solr/corename/select?q=field1:name1 to retrieve documents matching the query. You can rename select if you want it to match a more REST-ish naming scheme, such as /documents.

.. so it kind of depends on what your definition of a "Rest API" is.

There is way of making query requests through a content stream. If you don't want to use regular GET arguments ( ?q=field:foo&fq=field2:foo2 ), you can make a POST request (and for very extensive queries, that might be necessary) instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM