Hello Pradeep,
Re: 1, Yes, you've got the right idea, you can go to the admin panel and create
a field that includes /book/title and excludes the chapter or chapter/title
elements. You can then create a field constraint referencing that field by
name and use it in the Search API. The constraint configuration would look
like:
<constraint name="title">
<word>
<field name="my-title-field"/>
</word>
</constraint>
Re: 2, The Search API does not support inequality queries out of the box in
4.1. You would need to create custom "joiners" in the grammar or custom
constraints (depending on how you wanted to implement it). Take a look at
two sections of the Search Developer's Guide: "Creating a Custom Constraint",
and "Modifying and Extending the Search Parsing Grammar", for more details and
examples.
--Colleen
________________________________________
From: [email protected]
[[email protected]] On Behalf Of Pradeep Maddireddy
[[email protected]]
Sent: Friday, April 16, 2010 8:21 AM
To: General
Subject: [MarkLogic Dev General] Search API
Hi..!
We have XML files similar to the following structure
<book>
<title>Book Title</title>
<chapter>
<title>Chapter Title</title>
</chapter>
</book>
1.We need to provide a search capability to be able to search on book titile.
As element name of "book title" and "chapter title" are same, is it
possible to create a constraint or Field configuration ( Database
fields) and pass it to search API.
2. We also need to provide search capability to check
i) in case of a numeric field if "search param" is equal to, not
equal , greater than
or less than an element value. I know it is possible to accomplish
equal to and not equal to using constraint option of search API but
how can we accomplish greater than , less than conditions using search
API
ii) in case of a date field I need to be able to do is equal , is not
, before , after
is this possible using search API
Thanks
Pradeep Maddireddy
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general