Reputation: 2425
I'm trying to perform a solr query that includes 'More Like This' component. Can't find this scenario in the documentation. Here's a hypothetical sample Product entity with two fields -
{
product_name: "name of the product in 3 or 4 words"
product_description: "this is a long english verbose text, may be 10
sentences"
}
If I'm given a newProduct, I want to search for similar products in my Solr Index. The search should use the following logic -
How can this be accomplished with a single query to Solr?
Let me know if the scenario is not clear.
Upvotes: 1
Views: 1208
Reputation: 189
I think this is what you are looking for: https://wiki.apache.org/solr/MoreLikeThis#MoreLikeThisComponent
It uses the MoreLikeThis Component in search rather than having a separate handler.
Upvotes: 0
Reputation: 52892
You can use the More Like This request handler (mlt) to perform a "More Like Search" with a given document text without adding the document to the index first.
Include the document as the POST data or in the stream.body
parameter in the request. There's an example given in the old wiki - see "Using content streams":
If you post text in the body, that will be used for similarity. Alternatively, you can put the posted content in the URL using something like:
If remoteStreaming is enabled, you can find documents similar to the text on a webpage:
Upvotes: 1