Hi All, I'm building a feature that allows advanced users to specify a query by submitting an XML document containing elements and attributes whose values specify the element and attribute values that the results should match on. Users have the freedom to submit documents containing new elements that they want to query on and we want them to be able to do this without our having to create new indexes and option constraints each time they add a new element. I call this query by example.
I've done this by creating a cts:element-query for each element. The query wraps a cts:and-query of the element's text (if any) as a cts:word-query and each attribute's text as a cts:element-attribute-value-query. The resulting cts:element-querys are combined in a cts:and-query. The issue that I'm having is that I want to do a search:search to get a search:response rather than a cts:search that gives me the full content of the matching documents. I can achieve this by including my cts:and-query as an additional-query within my search:options and leaving the qtext empty. I considered using search:resolve but that requires my query to be a string. I tried using xmdp:quote and search:parse on my cts:and-query, but that just mangles the query and does not return results. Is including my generated query as an additional-query to search:search options the best way to do this or is there a way to convert my cts:and-query to a string for search:resolve that won't mangle it, or is there a better approach to implementing query by example than the path I have followed? Thanks. Bob
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
