Thanks Christian for your kind reply Currently front-end not generating the search combination ( (title = "United States" or isbn = "2345371242192") and author ="Jhon" ) just i am thinking, if i could achieve this way, so that i could ask fron-end person to send this way.
As per implementation, the front-end is not going to send XPATH for any field, I am thinking to generate XPATH on the fly and concatenating it with the search query which will be sent from front-end, is it possible? The XPATH will be on assumption as per field e.g.(if user select the field author then i have to look on XPATH (*:info/*:author)[1]/*:personname) For this search ( (title = "United States" or isbn = "2345371242192") and author ="Jhon" ) how should i ask to generate the query from front-end so that combination search can be achieved. Note: I have to create REST API for this service. Thanks On Tue, Nov 15, 2022 at 6:43 PM Christian Grün <christian.gr...@gmail.com> wrote: > Hi Dharmendra, > > Thanks for writing to the list. > > > I want to perform combination (AND OR) search on the basis of the > provided parameter by the user, where user will select the field name > e.g.(title, isbn, author) and their value from front-end so here field name > will be the parameter for the BaseX. > > > > Currently i am asking front-end person the generate below combination > query > > ( (title = "United States" or isbn = "2345371242192") and author ="Jhon" > ) > > Could you please give us more details on how this string is generated > by the frontend? > > Next, your XPath expression differs in many aspects from the frontend > representation. Some examples: > > • It seems that "author" needs to be mapped to: > normalize-space(string-join((*:info/*:author)[1]/*:personname//text()) > • "isbn" was mapped to $isbn="*:info/isban" (shouldn’t it be > *:info/*:isbn, and without quotes?) > > I assume that it’s not sufficient to map each frontend field to an element > name? > > Thanks in advance, > Christian >