[opencms-dev] Solr query specific index

Paul-Inge Flakstad flakstad at npolar.no
Tue Sep 15 11:51:34 CEST 2015


Hi Rüdiger,

Thanks for your suggestion, but this doesn’t seem to work for me.

When using <configuration>solr_fields</configuration> (the existing field configuration that references CmsSolrFieldConfiguration), things sort of “work”, but not for xmlcontent.

In my test folder, which contains various resource types, only PDFs and zip files were indexed. Images and xmlcontent were skipped. I have no idea why.

Tried adding the “xmlcontent” document type (in addition to the already existing xmlcontent-solr) in the source configuration, but it made no difference.

Anyway, thanks for your help :)

Cheers,
Paul

From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Rüdiger Kurz
Sent: 14. september 2015 22:56
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Solr query specific index


Hi,

try using the Solr field configuration
<configuration>solr_fields</configuration>

For Solr indexes this must reffer an implementation of CmsSolrFieldConfiguration.

Good luck
-Ruediger

On 14. September 2015 15:51:17 MESZ, Paul-Inge Flakstad <flakstad at npolar.no<mailto:flakstad at npolar.no>> wrote:
OK, so after some more careful reading, I understand that need to define a class on the <index> node.


I tried using the class used by the default index:
  <index class=”org.opencms.search.solr.CmsSolrIndex”>


This made the NPE go away, but I got zero results no matter what I do – even if I query for everything. It’s like nothing’s index ed. Re-building made no difference. On a side note: When I tested applying this class on the index that’s used in the “regular” site search – the index I’m actually trying to work with here – it broke. (Front-end searching just resulted in “Server error unknown”.)


I have no idea what I’m doing wrong here. :/ Do I have to write a custom class? Define the index/source differently?


My source consists of (mostly) xmlcontent. Here is what I tried so far (did not work):


<index class=”org.opencms.search.solr.CmsSolrIndex”>
  <name>my_index</name>
  <rebuild>auto</rebuild>
  <project>Online</project>
  <locale>en</locale>
  <configuration>standard</configuration>
  <sources>
    <source>my_source </source>
  </sources>
  <param name="org.opencms.search.CmsSearchIndex.checkTimeRange">false</param>
  <param name="search.solr.postProcessor">org.opencms.search.solr.CmsSolrLinkProcessor</param>
</index>
...
<indexsource>
  <name>my_source</name>
  <indexer class="org.opencms.search.CmsVfsIndexer"/>
  <resources>
    <resource>/sites/default/</resource>
  </resources>
  <documenttypes-indexed>
    <name>html</name>
    <name>text</name>
    <name>xmlcontent</name>
    <name>xmlcontent-solr</name>
    <name>xmlpage</name>
  </documenttypes-indexed>
</indexsource>


Cheers,
Paul


From: opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Paul-Inge Flakstad
Sent: 14. september 2015 13:22
To: The OpenCms mailing list
Subject: [opencms-dev] Solr query specific index


Hi,


I’d like to query a couple of OpenCms search indices (on an 8.5.2 instance) “directly” via the handleSolrSelect URI (or equivalent).


But: How do I “select” a specific index?


I have read the doc and tried the “core” parameter, like this:
http://myhost.com:8080/myopencms/opencms/handleSolrSelect?q=something&core=my_index


But that just results in a NPE:  “No Solr index named: my_index configured.”


PS: The handleSolrSelect URI works, but so far I can’t use it to query anything but the default index.


Med vennlig hilsen,
Paul-Inge Flakstad
Webutvikler, Norsk Polarinstitutt
flakstad at npolar.no<mailto:flakstad at npolar.no>  |  777 50 639



________________________________

This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev



--
Diese Nachricht wurde von meinem Mobiltelefon gesendet, bitte entschuldigen Sie etwaige Tippfehler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20150915/f4becdf2/attachment.htm>


More information about the opencms-dev mailing list