Lucene search on contents of several tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Lucene search on contents of several tags

Jonas Nielsen-2
Hi

I have the following lucene indices in collection.xconf

<lucene>
     <text qname="tei:text" />
     <text qname="tei:summary"/>
     <text qname="tei:placeName"/>
</lucene>

My xquery code then makes the following query:

let $query-results := ($documents[.//tei:text[ft:query(., $q)]],
                        $documents[.//tei:summary[ft:query(., $q)]],
                        $documents[.//tei:placeName[ft:query(., $q)]])

Now I want to, say, search on:

-pommern erik

Now all the documents in query-results have the word "erik" but not the
word "pommern" in the contents of the tei:text attribute.

But some of the results have both "erik" and "pommern" in the
tei:summary tag.

How do I make an xpath so that the user can search across all three tags
with lucene syntax (so that the contents of the three tags appears as
one text)?

Best regards

Jonas



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Lucene search on contents of several tags

Joe Wicentowski

On Thu, May 18, 2017 at 7:08 AM, Jonas Nielsen <[hidden email]> wrote:
Hi

I have the following lucene indices in collection.xconf

<lucene>
     <text qname="tei:text" />
     <text qname="tei:summary"/>
     <text qname="tei:placeName"/>
</lucene>

My xquery code then makes the following query:

let $query-results := ($documents[.//tei:text[ft:query(., $q)]],
                        $documents[.//tei:summary[ft:query(., $q)]],
                        $documents[.//tei:placeName[ft:query(., $q)]])

Now I want to, say, search on:

-pommern erik

Now all the documents in query-results have the word "erik" but not the
word "pommern" in the contents of the tei:text attribute.

But some of the results have both "erik" and "pommern" in the
tei:summary tag.

How do I make an xpath so that the user can search across all three tags
with lucene syntax (so that the contents of the three tags appears as
one text)?

Best regards

Jonas



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...