Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1870

Lucene block does not store attributes when instructed so

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.9
    • None
    • Blocks: Lucene
    • None
    • Normal
    • Patch available

    Description

      I tried to use the sample code and wanted to store some of my attributes
      as described in
      http://cocoon.apache.org/2.1/userdocs/concepts/xmlsearching.html

      However, the notation of "element@attribute" did not work with the
      LuceneIndexContentHandler. I believe I fixed it with the following code
      lines 122 ff.

        String atts_lname = atts.getLocalName(i);
        String atts_value = atts.getValue(i);
        if (isFieldTag(lname + "@" + atts_lname)) {
           bodyDocument.add(Field.UnIndexed(lname + "@" + atts_lname,
      atts_value));
        }
           bodyDocument.add(Field.UnStored(lname + "@" + atts_lname, atts_value));

      The if-statement was missing.

      Now my question, does this fix make sense? Can someone with experience
      validate this?

      Also, do you want me to create and issue and supply this towards it?

      Kind regards,
      Kaj

      Attachments

        Activity

          People

            Unassigned Unassigned
            kajkandler@conficio.com Kaj Kandler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: