How do you get kwic to work?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you get kwic to work?

John Preimonas-2
Hello eXist-db experts,
Why cannot I get results from the following XQuery:

xquery version "3.0";
import module namespace kwic="http://exist-db.org/xquery/kwic";

for $hit in collection('/db/apps/gliding/modules/data/flights')//log[ft:query(., "'thermal'")]  
order by ft:score($hit) descending
return
    kwic:summarize($hit, <config width=“40"/>)

I have read through the eXist documentation/Generating KWIC (Keywords in Context) Output, and now trying to run the kwic module in its simplest form and I get nothing.
What do I need to activate to get this function to work? I am using a standard install of eXist-db 2.2 on an iMac (yes - & I am over the Apple jokes!)

Regards, John


------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: How do you get kwic to work?

Alister Pillow-3
Hi John,

According to the docs, you must have an index defined on the “log” node.
Have you checked this? You can use “Monitoring and profiling for eXist” from the Dashboard. Use the Indexes link in the sidebar to see what you have defined.
Also, your search is for ‘thermal’ - not thermal.

To test your query, I used eXide to create a new XML document using the “eXist-db Collection Configuration” template (having read some messages about this last week).
I added this to the template:
<lucene>
            <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
            <text qname="person"/>
        </lucene>

Saved it into the target collection (and eXide asked about creating the corresponding /db/system file)
and then used the “Collections" Browser in the Dashboard to re-index that collection
I checked the results in Monex and then ran your query (changing the collection path and the element) and got the desired result.

 

> On 18 Jun 2015, at 7:56 pm, John Preimonas <[hidden email]> wrote:
>
> Hello eXist-db experts,
> Why cannot I get results from the following XQuery:
>
> xquery version "3.0";
> import module namespace kwic="http://exist-db.org/xquery/kwic";
>
> for $hit in collection('/db/apps/gliding/modules/data/flights')//log[ft:query(., "'thermal'")]  
> order by ft:score($hit) descending
> return
>    kwic:summarize($hit, <config width=“40"/>)
>
> I have read through the eXist documentation/Generating KWIC (Keywords in Context) Output, and now trying to run the kwic module in its simplest form and I get nothing.
> What do I need to activate to get this function to work? I am using a standard install of eXist-db 2.2 on an iMac (yes - & I am over the Apple jokes!)
>
> Regards, John
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: How do you get kwic to work?

Jens Østergaard Petersen-2
In reply to this post by John Preimonas-2
Hi John,

What happens if you do the following (assuming you have the eXist documentation app installed)?

#

xquery version "3.0";

import module namespace kwic="http://exist-db.org/xquery/kwic";

for $hit in collection('/db/apps/doc/data/')//*[ft:query(., 'lucene')] 
order by ft:score($hit) descending
    return
        kwic:summarize($hit, <config width="40"/>)

#

Are namespaces involved in your case? Is anything returned if you just “return $hit”?

As far as I can figure out, the majority of Mac developers are using Macs, so there is no need to excuse ….

Best,

Jens

On 18 Jun 2015 at 12:28:15, John Preimonas ([hidden email]) wrote:

Hello eXist-db experts,
Why cannot I get results from the following XQuery:

xquery version "3.0";
import module namespace kwic="http://exist-db.org/xquery/kwic";

for $hit in collection('/db/apps/gliding/modules/data/flights')//log[ft:query(., "'thermal'")]
order by ft:score($hit) descending
return
kwic:summarize($hit, <config width=“40"/>)

I have read through the eXist documentation/Generating KWIC (Keywords in Context) Output, and now trying to run the kwic module in its simplest form and I get nothing.
What do I need to activate to get this function to work? I am using a standard install of eXist-db 2.2 on an iMac (yes - & I am over the Apple jokes!)

Regards, John


------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: How do you get kwic to work?

John Preimonas-2
I get the following and lot more:

Querying lucene from XQuery is straightforward. For example:

... nes the amount of memory (in megabytes) Lucene will use for ...

... See the Lucene javadocs .

... process downloads the required Lucene jars automatically. If everything ...

... builds OK, you should find a jar exist-lucene-module.jar in the lib/extensions dir ...

... file, conf.xml and un-comment the Lucene-related sect ...


…and more….


On 18 Jun 2015, at 9:23 pm, Jens Østergaard Petersen <[hidden email]> wrote:

Hi John,

What happens if you do the following (assuming you have the eXist documentation app installed)?

#

xquery version "3.0";

import module namespace kwic="http://exist-db.org/xquery/kwic";

for $hit in collection('/db/apps/doc/data/')//*[ft:query(., 'lucene')] 
order by ft:score($hit) descending
    return
        kwic:summarize($hit, <config width="40"/>)

#

Are namespaces involved in your case? Is anything returned if you just “return $hit”?

As far as I can figure out, the majority of Mac developers are using Macs, so there is no need to excuse ….

Best,

Jens

On 18 Jun 2015 at 12:28:15, John Preimonas ([hidden email]) wrote:

Hello eXist-db experts,
Why cannot I get results from the following XQuery:

xquery version "3.0";
import module namespace kwic="http://exist-db.org/xquery/kwic";

for $hit in collection('/db/apps/gliding/modules/data/flights')//log[ft:query(., "'thermal'")]  
order by ft:score($hit) descending
return
kwic:summarize($hit, <config width=“40"/>)

I have read through the eXist documentation/Generating KWIC (Keywords in Context) Output, and now trying to run the kwic module in its simplest form and I get nothing.
What do I need to activate to get this function to work? I am using a standard install of eXist-db 2.2 on an iMac (yes - & I am over the Apple jokes!)

Regards, John


------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: How do you get kwic to work?

Dannes Wessels-3
Maybe the lucene Indexer class has moved to another package?

Maybe the log file provides a clue....

D.

--
www.exist-db.org

> On 18 Jun 2015, at 12:34, John Preimonas <[hidden email]> wrote:
>
> I get the following and lot more:

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open