• HCMC Blogs
  • Moses
  • Maint
  • Mariage
  • Admin
  • Academic
  • Depts
  • ScanCan
  • HumsSites
  • Projects
  • Pro-D
  • ColDesp
  • CanMys
  • LondonMap
  • AdaptiveDB
  • MoM
  • Cascade
  • Landscapes
  • Linguistics
  • CGWP
  • Endings
  • LEMDO
  • DVPP
  • Wendat
  • Announcements

Contact Us on 0800 123 4567 or info@example.com

MyNDIR

  • Front Page
  • Contact
  • Log in
  • « Search now working
  • finished vignettes in SKng »

SOLVED: Problems with ft:query / Lucene indexer

Posted by mholmes on 27 May 2010 in Activity log

Update to the post below: this problem was solved on advice from JW on the eXist list, to move the tei xmlns attribute in collection.xconf from the root <collection> element to the child <index> element.

Began working on the Search textbox, which I was going to base on the Lucene index, but after setting up the appropriate collection.xconf and re-indexing, I was unable to make it work. After trying to debug this for a while, I ended up posting a message to the eXist list, which I'll reproduce here because it explains the problem clearly:

When I run this query:

  declare default element namespace "http://www.tei-c.org/ns/1.0";
  declare namespace ft = "http://exist-db.org/xquery/lucene";

  for $p in collection('/db/myndir/names/')//person[ft:query(., "killed")]
     return $p

I get no results, but when I run this:

  for $p in collection('/db/myndir/names/')//tei:person[contains(., "killed")]
     return $p

I get 11 results, as expected. Can anyone suggest what the problem might be?

This is the setup:

eXist was built with Cocoon, with Lucene enabled in build.properties:

include.index.lucene = true

The exist-lucene-module.jar file is present, and Lucene is enabled in conf.xml:

  <module id="lucene-index" class="org.exist.indexing.lucene.LuceneIndex" buffer="32"/>

  <modules>
    <module id="lucene-index"
          class="org.exist.indexing.lucene.LuceneIndex" buffer="32"/>
    ...
  </modules>
  ...
  <builtin-modules>
    <module id="lucene-index"
            class="org.exist.indexing.lucene.LuceneIndex"/>
    ...
  </builtin-modules>

I have the following collections.xconf file at /db/system/config/db/myndir/names/:

<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://exist-db.org/collection-config/1.0"
  xmlns:tei="http://www.tei-c.org/ns/1.0">
  <index>
    <!-- Old full text index configuration. Deprecated. -->
    <fulltext default="none" attributes="no">
    </fulltext>

    <!-- New full text index based on Lucene -->
    <lucene>
      <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
      <analyzer id="ws" class="org.apache.lucene.analysis.WhitespaceAnalyzer"/>
      <text qname="tei:person"/>
    </lucene>

    <!-- Range indexes -->
    <create qname="tei:person" type="xs:string"/>

  </index>
</collection>

and I have re-indexed the collection. eXist does not appear to be writing any logs, other than a large binary file called "0000000043.log" which is in WEB-INF/data. Cocoon's log doesn't show anything useful.

I have no idea why logging isn't working here. That's something we probably want to tackle, but I have no idea where to start. We also should probably consider building another eXist-1.4 + Cocoon using our build script, in case anything major has been fixed since December, but I'll wait for the response on the eXist list to see if that might help; we have so many projects already using our original build that the time investment in porting would be considerable.

This entry was posted by Martin and filed under Activity log.

MyNDIR

  • Home
  • Recently
  • Archives
  • Categories
  • Latest comments

Search

Categories

  • All
  • Activity log
  • Tasks

XML Feeds

  • RSS 2.0: Posts
  • Atom: Posts
What is RSS?

Recent Posts

  • Finding an obscure issue
  • First steps in generating HTML5
  • Standalone XML now building; code reorganized
  • Jenkins job set up; schema and validation build reworked
  • PAB moved to svn
  • Beginning Endings work
  • Meeting, confirmation of plan
  • Project plan, Endings-style
  • Tweaks to captions
  • Finished diagnostics, sent results

Sidebar 2

This is the "Sidebar 2" container. You can place any widget you like in here. In the evo toolbar at the top of this page, select "Customize", then "Blog Widgets".

This collection ©2026 by admin • Help • Run your own website!