[MarkLogic Dev General] creating a search:search constraint for finding similar results of a node
Colleen.Whitney at marklogic.com
Mon Jan 23 12:37:17 PST 2012
I don't know if this would meet your needs or not...but there is already a <return-similar> option you can set to true in the options wrapper; what you get is a list of similar URIs for each search result (the result itself is supplied as the node from which matches are made). It runs a cts:similar-query for each result, so you'd need to think about performance considerations; and of course since it uses the whole document it might not be as precise as you might like.
I'm not sure I can picture how the constraint approach would look and work...if doing <return-similar>true</return-similar> in your options doesn't work, can you say a little more about how you picture that working with the search grammar?
From: general-bounces at developer.marklogic.com [general-bounces at developer.marklogic.com] On Behalf Of DJaun Maclin [dmaclin at wattnet.net]
Sent: Monday, January 23, 2012 12:29 PM
To: General MarkLogic Developer Discussion
Cc: Robert Tuten
Subject: [MarkLogic Dev General] creating a search:search constraint for finding similar results of a node
I am very interesting in creating a search:search constraint called “similar” that returns the similar nodes to the node given to the constraint. I see it is possible, but I’m having trouble finding out which way to go. I would love to make it a constraint so that it can be used in the search formula if needed. Please let me now if anyone has experienced this or know of a way to accomplish similar results as a constraint in the search api.
BTW: I could pass the similar constraint an id, title, unique link in order to provide the node to which similar matches would need to be made.
Thanks a bunch!
WATT Knowledge • Solutions • Success
Email: Dmaclin at wattnet.net<mailto:Dmaclin at wattnet.net>
This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. WATT Publishing Co. and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt.
More information about the General