Re: Lucene Data Integration in the Web App

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

Re: Lucene Data Integration in the Web App

Stanislaw Osinski
Administrator
Hi David,

I created the XML file in Workbench and placed it in the suite.  The tab is showing up but I am getting the following message when attempting to search."Our apologies, the following processing error has occurred:At least one search field must be given for a plain text query. Alternatively, use a Lucene Query object."

It looks like you configured the Lucene document source only partially -- you also need to select which Lucene fields will provide title, content and (optionally) content URLs for the search snippets. To see these fields in the Search view, you need to set it to show optional fields as described here:

http://download.carrot2.org/head/manual/#section.getting-started.lucene

Then, when you set the fields, the saved XML file would look along the lines of the example we distribute:

https://carrot2.svn.sourceforge.net/svnroot/carrot2/trunk/core/carrot2-component-suites/suites/suites/source-lucene-attributes.xml

Finally, if you have further questions, please post on the mailing list, so that others can answer and benefit.

Cheers,

Staszek

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: Lucene Data Integration in the Web App

Sohe
Hi,

Thank you for your reply previously. Now, I have got the same message as David. I have used your workbench to generate source-lucene-attributes.xml by inputing all necessary fields as you have suggested (index path, title, content and url), but I still got the same message. The following code is the one that I have modified from the generated XML file. I modified it because it contains no <indexPath> tag and that it has different <value> tag from your example. So, what would be the possible causes?

Sincerely,
Pongdej

<attribute-sets default="overridden-attributes">
  <attribute-set id="overridden-attributes">
    <value-set based-on="defaults">
      <label>overridden-attributes</label>
      <attribute key="LuceneDocumentSource.analyzer">
        <value type="java.lang.Class" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
      </attribute>
      <attribute key="LuceneDocumentSource.directory">
        <value>
          <wrapper class="org.carrot2.source.lucene.FSDirectoryWrapper">
            <indexPath>[PATH_TO_INDEX]</indexPath>
          </wrapper>
        </value>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
        <value type="java.lang.String" value="content"/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
        <value type="java.lang.Class" value="org.carrot2.source.lucene.PlainTextFormatter"/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
        <value type="java.lang.String" value=""/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
        <value type="java.lang.String" value="title"/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
        <value type="java.lang.String" value="url"/>
      </attribute>
    </value-set>
  </attribute-set>
  <attribute-set id="defaults">
    <value-set>
      <label>defaults</label>
      <attribute key="LuceneDocumentSource.analyzer">
        <value>
          <wrapper class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
        </value>
      </attribute>
      <attribute key="LuceneDocumentSource.directory">
        <value/>
      </attribute>
      <attribute key="LuceneDocumentSource.fieldMapper">
        <value>
          <wrapper class="org.carrot2.source.lucene.SimpleFieldMapper"/>
        </value>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
        <value/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.contextFragments">
        <value type="java.lang.Integer" value="3"/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
        <value>
          <wrapper class="org.carrot2.source.lucene.PlainTextFormatter"/>
        </value>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
        <value value="..."/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.searchFields">
        <value/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
        <value/>
      </attribute>
      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
        <value/>
      </attribute>
    </value-set>
  </attribute-set>
</attribute-sets>


[PATH_TO_INDEX] is where I have actually replaced it with my path to index.

Stanislaw Osinski wrote
Hi David,

I created the XML file in Workbench and placed it in the suite.  The tab is
> showing up but I am getting the following message when attempting to
> search."Our apologies, the following processing error has occurred:At least
> one search field must be given for a plain text query. Alternatively, use a
> Lucene Query object."
>

It looks like you configured the Lucene document source only partially --
you also need to select which Lucene fields will provide title, content and
(optionally) content URLs for the search snippets. To see these fields in
the Search view, you need to set it to show optional fields as described
here:

http://download.carrot2.org/head/manual/#section.getting-started.lucene

Then, when you set the fields, the saved XML file would look along the lines
of the example we distribute:

https://carrot2.svn.sourceforge.net/svnroot/carrot2/trunk/core/carrot2-component-suites/suites/suites/source-lucene-attributes.xml

Finally, if you have further questions, please post on the mailing list, so
that others can answer and benefit.

Cheers,

Staszek

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: Lucene Data Integration in the Web App

Stanislaw Osinski
Administrator
Hi Pongdej, David,

Apologies I didn't check this properly before. Indeed, due to some bug, the file generated in the Workbench wouldn't work with the webapp. For now, a quick workaround is to remove the based-on="defaults" attribute from the <value-set> at the top (you may want to remove the whole "defaults" attribute set too as it becomes unused). Later this week, I'll look into the cause of this bug.

Thanks for the report, please let me know if the workaround helped.

Cheers,

Staszek


On Mon, Dec 21, 2009 at 18:03, Sohe <[hidden email]> wrote:

Hi,

Thank you for your reply previously. Now, I have got the same message as
David. I have used your workbench to generate source-lucene-attributes.xml
by inputing all necessary fields as you have suggested (index path, title,
content and url), but I still got the same message. The following code is
the one that I have modified from the generated XML file. I modified it
because it contains no <indexPath> tag and that it has different <value> tag
from your example. So, what would be the possible causes?

Sincerely,
Pongdej

<attribute-sets default="overridden-attributes">
 <attribute-set id="overridden-attributes">
   <value-set based-on="defaults">
     <label>overridden-attributes</label>
     <attribute key="LuceneDocumentSource.analyzer">
       <value type="java.lang.Class"
value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
     </attribute>
     <attribute key="LuceneDocumentSource.directory">
       <value>
         <wrapper class="org.carrot2.source.lucene.FSDirectoryWrapper">
           <indexPath>[PATH_TO_INDEX]</indexPath>
         </wrapper>
       </value>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
       <value type="java.lang.String" value="content"/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
       <value type="java.lang.Class"
value="org.carrot2.source.lucene.PlainTextFormatter"/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
       <value type="java.lang.String" value=""/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
       <value type="java.lang.String" value="title"/>
     </attribute>
     <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
       <value type="java.lang.String" value="url"/>
     </attribute>
   </value-set>
 </attribute-set>
 <attribute-set id="defaults">
   <value-set>
     <label>defaults</label>
     <attribute key="LuceneDocumentSource.analyzer">
       <value>
         <wrapper
class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
       </value>
     </attribute>
     <attribute key="LuceneDocumentSource.directory">
       <value/>
     </attribute>
     <attribute key="LuceneDocumentSource.fieldMapper">
       <value>
         <wrapper class="org.carrot2.source.lucene.SimpleFieldMapper"/>
       </value>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
       <value/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.contextFragments">
       <value type="java.lang.Integer" value="3"/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
       <value>
         <wrapper class="org.carrot2.source.lucene.PlainTextFormatter"/>
       </value>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
       <value value="..."/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.searchFields">
       <value/>
     </attribute>
     <attribute
key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
       <value/>
     </attribute>
     <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
       <value/>
     </attribute>
   </value-set>
 </attribute-set>
</attribute-sets>


[PATH_TO_INDEX] is where I have actually replaced it with my path to index.



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: Lucene Data Integration in the Web App

Stanislaw Osinski
Administrator
Hi again,

As a follow-up, I've fixed the root cause of this bug: http://issues.carrot2.org/browse/CARROT-603 in trunk, the fix will be available in the next stable release. Thanks for reporting the issue!

S.

On Mon, Dec 21, 2009 at 18:30, Stanislaw Osinski <[hidden email]> wrote:
Hi Pongdej, David,

Apologies I didn't check this properly before. Indeed, due to some bug, the file generated in the Workbench wouldn't work with the webapp. For now, a quick workaround is to remove the based-on="defaults" attribute from the <value-set> at the top (you may want to remove the whole "defaults" attribute set too as it becomes unused). Later this week, I'll look into the cause of this bug.

Thanks for the report, please let me know if the workaround helped.

Cheers,

Staszek




------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: Lucene Data Integration in the Web App

Sohe
In reply to this post by Stanislaw Osinski

Hi,

Thank you so much, your workaround helped !

Sincerely,
Pongdej

Stanislaw Osinski wrote
Hi Pongdej, David,

Apologies I didn't check this properly before. Indeed, due to some bug, the
file generated in the Workbench wouldn't work with the webapp. For now, a
quick workaround is to remove the based-on="defaults" attribute from the
<value-set> at the top (you may want to remove the whole "defaults"
attribute set too as it becomes unused). Later this week, I'll look into the
cause of this bug.

Thanks for the report, please let me know if the workaround helped.

Cheers,

Staszek


On Mon, Dec 21, 2009 at 18:03, Sohe <kenshin153@gmail.com> wrote:

>
> Hi,
>
> Thank you for your reply previously. Now, I have got the same message as
> David. I have used your workbench to generate source-lucene-attributes.xml
> by inputing all necessary fields as you have suggested (index path, title,
> content and url), but I still got the same message. The following code is
> the one that I have modified from the generated XML file. I modified it
> because it contains no <indexPath> tag and that it has different <value>
> tag
> from your example. So, what would be the possible causes?
>
> Sincerely,
> Pongdej
>
> <attribute-sets default="overridden-attributes">
>  <attribute-set id="overridden-attributes">
>    <value-set based-on="defaults">
>      <label>overridden-attributes</label>
>      <attribute key="LuceneDocumentSource.analyzer">
>        <value type="java.lang.Class"
> value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
>      </attribute>
>      <attribute key="LuceneDocumentSource.directory">
>        <value>
>          <wrapper class="org.carrot2.source.lucene.FSDirectoryWrapper">
>            <indexPath>[PATH_TO_INDEX]</indexPath>
>          </wrapper>
>        </value>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
>        <value type="java.lang.String" value="content"/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
>        <value type="java.lang.Class"
> value="org.carrot2.source.lucene.PlainTextFormatter"/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
>        <value type="java.lang.String" value=""/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
>        <value type="java.lang.String" value="title"/>
>      </attribute>
>      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
>        <value type="java.lang.String" value="url"/>
>      </attribute>
>    </value-set>
>  </attribute-set>
>  <attribute-set id="defaults">
>    <value-set>
>      <label>defaults</label>
>      <attribute key="LuceneDocumentSource.analyzer">
>        <value>
>          <wrapper
> class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
>        </value>
>      </attribute>
>      <attribute key="LuceneDocumentSource.directory">
>        <value/>
>      </attribute>
>      <attribute key="LuceneDocumentSource.fieldMapper">
>        <value>
>          <wrapper class="org.carrot2.source.lucene.SimpleFieldMapper"/>
>        </value>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.contentField">
>        <value/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.contextFragments">
>        <value type="java.lang.Integer" value="3"/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.formatter">
>        <value>
>          <wrapper class="org.carrot2.source.lucene.PlainTextFormatter"/>
>        </value>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.fragmentJoin">
>        <value value="..."/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.searchFields">
>        <value/>
>      </attribute>
>      <attribute
> key="org.carrot2.source.lucene.SimpleFieldMapper.titleField">
>        <value/>
>      </attribute>
>      <attribute key="org.carrot2.source.lucene.SimpleFieldMapper.urlField">
>        <value/>
>      </attribute>
>    </value-set>
>  </attribute-set>
> </attribute-sets>
>
>
> [PATH_TO_INDEX] is where I have actually replaced it with my path to index.
>
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers