Changeset 12376


Ignore:
Timestamp:
2006-08-02T15:05:48+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now stores term vectors (for the TX field only), to support query term occurrences. Many thanks to John Thompson and DL Consulting Ltd.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/java/org/nzdl/gsdl/LuceneWrap/Indexer.java

    r12257 r12376  
    155155    public void endElement(String uri, String localName, String qName) throws SAXException
    156156    {
    157     if (qName.equals(indexable_current_node_)) {
    158         current_doc_.add(new Field(qName, current_contents_, Field.Store.NO, Field.Index.TOKENIZED));
    159         current_contents_ = "";
    160     }
     157    if (qName.equals(indexable_current_node_))
     158            {
     159                current_doc_.add(new Field(qName, current_contents_, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.YES));
     160                // We only need the term vector for the TX field
     161                if (!qName.equals("TX"))
     162                    {
     163                        current_doc_.add(new Field("by" + qName, current_contents_, Field.Store.NO, Field.Index.UN_TOKENIZED, Field.TermVector.NO));
     164                    }
     165
     166                current_contents_ = "";
     167            }
    161168
    162169    if (qName.equals(doc_tag_level_)) {
  • trunk/indexers/lucene-gs/src/org/greenstone/LuceneWrapper/Indexer.java

    r12257 r12376  
    155155    public void endElement(String uri, String localName, String qName) throws SAXException
    156156    {
    157     if (qName.equals(indexable_current_node_)) {
    158         current_doc_.add(new Field(qName, current_contents_, Field.Store.NO, Field.Index.TOKENIZED));
    159         current_contents_ = "";
    160     }
     157    if (qName.equals(indexable_current_node_))
     158            {
     159                current_doc_.add(new Field(qName, current_contents_, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.YES));
     160                // We only need the term vector for the TX field
     161                if (!qName.equals("TX"))
     162                    {
     163                        current_doc_.add(new Field("by" + qName, current_contents_, Field.Store.NO, Field.Index.UN_TOKENIZED, Field.TermVector.NO));
     164                    }
     165
     166                current_contents_ = "";
     167            }
    161168
    162169    if (qName.equals(doc_tag_level_)) {
Note: See TracChangeset for help on using the changeset viewer.