« Back to Search

Pluggable Enterprise Search with Solr

Using a Solr Server for Liferay Search #

Since Solr is a standalone search engine, you will need to download it and install it first according to the instructions on the Solr web site ([http://lucene.apache.org/solr]). Once you have Solr up and running, integrating it with Liferay is easy, but it will require a restart of your application server.

Installing Solr #

The first thing you will need to define is the location of your search index. Assuming you are running a Linux server and you have mounted a file system for the index at /solr, create an environment variable that points to this folder. This environment variable needs to be called $SOLR_HOME. So for our example, we would define:

 $SOLR_HOME=/solr

This environment variable can be defined anywhere you need: in your operating system's start up sequence, in the environment for the user who is logged in, or in the start up script for your application server. If you are going to use Tomcat to host Solr, you would modify catalina.sh or catalina.bat and add the environment variable there.

Once you have created the environment variable, you then can use it in your application server's start up configuration as a parameter to your JVM. This is configured differently per application server, but again, if you are using Tomcat, you would edit catalina.sh or catalina.bat and append the following to the $JAVA_OPTS variable:

 -Dsolr.solr.home=$SOLR_HOME

This takes care of telling Solr where to store its search index.

Installing the Solr Plugin #

Next, you have a choice. If you have installed Solr on the same system upon which Liferay is running, you can simply go to a Plugin Installer portlet and install the solr-web plugin. Of course, if you are doing this for a clustered environment, it is likely that you are not running Liferay and your search engine on the same box, so you will have to make a change to a configuration file in the plugin before you install it. In this case, go to the Liferay web site (http://www.liferay.com) and download the plugin manually.

Open or extract the plugin. Inside the plugin, you will find a file called solr-spring.xml in the WEB-INF/classes/META-INF folder. Open this file in a text editor and you will see that there are two entries which define where the Solr server can be found by Liferay:

 <bean id="indexSearcher" class="com.liferay.portal.search.solr.SolrIndexSearcherImpl">
     <property name="serverURL" value="http://localhost:8080/solr/select" />
 </bean>
 <bean id="indexWriter" class="com.liferay.portal.search.solr.SolrIndexWriterImpl">
     <property name="serverURL" value="http://localhost:8080/solr/update" />
 </bean>

Modify these values so that they point to the server upon which you are running Solr. Then save the file and put it back into the plugin archive in the same place it was before.

Next, extract the file schema.xml from the plugin. This xml file describes how the fields will be indexed to the Solr index and it should be located in the docroot/WEB-INF/conf folder. Copy this file to $SOLR_HOME/conf (you may have to create the conf directory). Now go ahead and start the application server upon which you are going to install Solr. This can be the same server Liferay is running on or a completely different box (a separate box for your search server will give you better performance). Install the Solr .war file to this application server.

You can now hot deploy the solr-web plugin to all of your nodes.

Once the plugin is hot deployed, your Liferay search is automatically upgraded to use Solr. It is likely, however, that initial searches will come up with nothing: this is because you will need to reindex everything using Solr.

Go to the Admin Portlet. Click the Server tab and then click the Execute button next to Reindex all search indexes. It may take a while, but Liferay will begin sending indexing requests to Solr for execution. When the process is complete, Solr will have a complete search index of your site, and will be running independently of all of your Liferay nodes.

Installing the plugin to your nodes has the effect of overriding any calls to Lucene for searching. All of Liferay's search boxes will now use Solr as the search index. This is ideal for a clustered environment, as it allows all of your nodes to share one search server and one search index, and this search server operates independently of all of your nodes.

1 Attachment
37936 Views
Average (2 Votes)
Comments

Showing 35 Comments

Marcelo Ruiz Camauër
8/15/08 7:10 AM

Great stuff, but can you say something about what the benefits would be? What additional capabilities does it have or how is it better? Will LR move to solr by default in the future?

Bruno Farache
8/15/08 4:42 PM

Hi Marcelo, Solr fixes some problems we have with clustered portal, think as an replacement of Lucene JDBC.

There is an performance improvement if you have many search requests, you can setup several Solr instances to handle these requests. Liferay will continue to use Lucene as a default impl.

brian mcsweeney
8/17/08 11:27 AM

Could you also tell, is there a frontend (a plugin etc) which will show how to use the solr interface to search the database. If I am understanding things correctly, all the plugin does is sets up solr to just index the data again. However, it doesn't talk about how to use solr from a web page etc. Is there any example of this?

cheers,
Brian

Bruno Farache
8/18/08 6:03 PM

Hi Brian,

I don't remember any current plugin that does searching, but you can take a look at how this is done by looking at some portlets in the core. Try to search for Indexer.java (this is called whenever an entity is added) and for search methods within *LocalServiceImpl.java classes.

Anyways, it's a good idea to have a sample-search-portlet or something like that, thank you for bringing this up.

Besides using the portal to make searches you can also use an web interface that comes with Solr, you just need to go to http://{solr.address}/solr. It has a simple interface but I think it's easy to change it. Solr also provides search results based on a given XSLT file. For more info, take a look at Solr's documentation:


http://wiki.apache.org/solr/XsltResponseWriter?highlight=(xslt)
htt­p://wiki.apache.org/solr/SolrAdminGUI

A good introductory article about Solr:

http://www.ibm.com/developerworks/java/library/j-solr1/

Bruno Farache
8/18/08 6:22 PM

I not sure if I answered you question correctly, clarifying it more:

Solr is not only used for indexing. The portal picks whichever search plugin is installed at the moment and uses it for both indexing and searching.

brian mcsweeney
8/19/08 10:29 AM

Hi Bruno,

excellent answer. Thanks very much. Just to make sure I'm correct, so are you saying if you just install the solr plugin and restart liferay, then all searches in liferay will automatically switch to using solr under the hood?

Definitely I think a sample search portlet that uses it would be great. Also, am I right in thinking that Solr simplifies the querying process, vs straight Lucene for example, as it accepts XSLT as you say.

Anyway, will have a look at your links, thanks very much for your help.

Brian

Bruno Farache
8/23/08 6:06 AM

Hi Brian,

No, as this Wiki page explains, after the plugin is installed you need to go to the Admin porltet and click on "Reindex all search indexes".

Carlos del Castillo
9/30/08 4:49 PM

Thank you very much for the information, I have installed solr and the plugin and seems to work fin for the blog entries and wiki, but not the discussions.

I installed Solr with the schema attached to this wiki. and Solr indexed the content from the discussions but when busing the search function on the discussion portlet nothing is displayed.

Any ideas what could be causing this problem?

Thanks!

Bruno Farache
10/2/08 8:38 AM

Fixed in http://support.liferay.com/browse/LEP-7724

kuhajeyan gunaratnam
11/19/08 6:29 AM

i have a question, by deploying the plug-in every search directed to solr? (mm,, probably with admin re-indexing or whatever). How about if i want to revert back to default lucene. just remove the portlet would do? May be i dont quite understand how liferay were able to make a conclusion that, it would direct all its searches just by knowing the solr war is there. can you explain a bit more.

thanks

kuhajeyan gunaratnam
11/19/08 6:37 AM

btw, what is the evident that the searching is using solr indexes (after having completed all these steps successfully) and how much do i have the control over it?

suresh midde
12/23/08 12:11 PM

Hi ,
I have configured Solr server on my localhost,It is running fine on http://localhost:8983/solr/admin

And I have created a folder by name Solr in my local C Drive and I have copied schema.xml under solr/conf.

I have set SOLR_HOME = c:/solr
and appended -Dsolr.solr.home=%SOLR_HOME% for java_opts

And I have a doubt regarding solr-spring.xml, the port no should be my server (tomcat) running port or the port on which solr is running

<bean id="indexSearcher" class="com.liferay.portal.search.solr.SolrIndexSearcherImpl">
<property name="serverURL" value="[http://localhost:8080/solr/select"] />
</bean>
<bean id="indexWriter" class="com.liferay.portal.search.solr.SolrIndexWriterImpl">
<property name="serverURL" value="[http://localhost:8080/solr/update"] />
</bean>


And I have deployed using plugin installer of application.

"Once the plugin is hot deployed, your Liferay search is automatically upgraded to use Solr."

how does i come to know, the search is now by solr not by lucene and I was getting results in intial searches against this line "It is likely, however, that initial searches will come up with nothing: this is because you will need to reindex everything using Solr."

Finally my lucene folder under liferay , is getting modified by current time and I could not find any index files generating under my solr home.

Was I doing anything wrong, any help highly appreciated.

Regards
Suresh Midde

Bruno Farache
1/14/09 8:05 AM

Kuhajeyan, you're right, undeploying Solr plugin will default back to Lucene. You would just need to reindex the portal against Lucene.

Look at Solr admin UI to check if your content is being indexed.

Diego Alejandro Palmeira
4/28/09 2:03 AM

Hello, I'm using Liferay 5.2.2 ,and the solr plugin (solr-web-5.2.0.1.war) with solr 1.3.

But when I try to search users, an error occur.
Take a look at this post:
https://www.liferay.com/web/guest/community/forums/-/message_boards/message­/2957400/maximized

Can you help us?

Thank you
Diego

taizeq tai
6/2/09 9:05 PM

hi guy,
i want same advise n help.

i use liferay 5.1.1

And I have created a folder by name Solr in my local C Drive and I have copied schema.xml under solr/conf.

I have set SOLR_HOME = c:/solr
in fail setenv.bat, i add -Dsolr.solr.home=%SOLR_HOME%

And I have change in solr-spring.xml,

<bean id="indexSearcher" class="com.liferay.portal.search.solr.SolrIndexSearcherImpl">
<property name="serverURL" value="http://localhost:6080/solr/select" />
</bean>
<bean id="indexWriter" class="com.liferay.portal.search.solr.SolrIndexWriterImpl">
<property name="serverURL" value="http://localhost:6080/solr/update" />
</bean>

but after i running liferay..this error appear..
Jun 3, 2009 3:58:01 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-6080
Jun 3, 2009 3:58:01 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:6009
Jun 3, 2009 3:58:01 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Jun 3, 2009 3:58:01 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 32029 ms
03:58:30,765 ERROR [SolrIndexSearcherImpl:79] Error while sending request to Solr
java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.subset(SolrIndexSearcherImp­l.java:102)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:76)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:78)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:92)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:75)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:46)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­85)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
03:58:30,765 ERROR [SolrReaderMessageListener:49] Unable to process message com.liferay.portal.kernel.messaging.Message@1c3a0dd
com.liferay.portal.kernel.sea­rch.SearchException: java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:81)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:78)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:92)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:75)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:46)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­85)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.subset(SolrIndexSearcherImp­l.java:102)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:76)
... 9 more
03:58:40,687 ERROR [IncludeTag:52] Current URL /web/guest/home generates exception: javax.servlet.ServletException: com.liferay.portal.SystemException
: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.messaging.MessageBusException: No reply received for request: com.lifera
y.portal.kernel.messaging.Message@1c3a0dd
03:58:40,703 ERROR [IncludeTag:52] com.liferay.portal.SystemException: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.mes
saging.MessageBusException: No reply received for request: com.liferay.portal.kernel.messaging.Message@1c3a0dd
at com.liferay.portal.plugin.PluginPackageUtil._search(PluginPackageUtil.java:1253)­
at com.liferay.portal.plugin.PluginPackageUtil.search(PluginPackageUtil.java:238)

ca­n anyone help me out.

taizeq tai
6/2/09 9:09 PM

hii team,

i using liferay 5.1.1

And I have created a folder by name Solr in my local C Drive and I have copied schema.xml under solr/conf.

I have set SOLR_HOME = c:/solr
and add -Dsolr.solr.home=%SOLR_HOME% in fail setenv.bat

And I have change solr-spring.xml like this

<bean id="indexSearcher" class="com.liferay.portal.search.solr.SolrIndexSearcherImpl">
<property name="serverURL" value="http://localhost:6080/solr/select" />
</bean>
<bean id="indexWriter" class="com.liferay.portal.search.solr.SolrIndexWriterImpl">
<property name="serverURL" value="http://localhost:6080/solr/update" />
</bean>

the error appear when i running liferay.

Jun 3, 2009 3:58:01 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-6080
Jun 3, 2009 3:58:01 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:6009
Jun 3, 2009 3:58:01 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Jun 3, 2009 3:58:01 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 32029 ms
03:58:30,765 ERROR [SolrIndexSearcherImpl:79] Error while sending request to Solr
java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.subset(SolrIndexSearcherImp­l.java:102)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:76)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:78)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:92)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:75)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:46)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­85)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
03:58:30,765 ERROR [SolrReaderMessageListener:49] Unable to process message com.liferay.portal.kernel.messaging.Message@1c3a0dd
com.liferay.portal.kernel.sea­rch.SearchException: java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:81)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:78)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:92)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:75)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:46)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­85)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.subset(SolrIndexSearcherImp­l.java:102)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:76)
... 9 more
03:58:40,687 ERROR [IncludeTag:52] Current URL /web/guest/home generates exception: javax.servlet.ServletException: com.liferay.portal.SystemException
: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.messaging.MessageBusException: No reply received for request: com.lifera
y.portal.kernel.messaging.Message@1c3a0dd
03:58:40,703 ERROR [IncludeTag:52] com.liferay.portal.SystemException: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.mes
saging.MessageBusException: No reply received for request: com.liferay.portal.kernel.messaging.Message@1c3a0dd
at com.liferay.portal.plugin.PluginPackageUtil._search(PluginPackageUtil.java:1253)­
at com.liferay.portal.plugin.PluginPackageUtil.search(PluginPackageUtil.java:238)

ca­n anyone show me the right way..

Fuad Efendi
6/20/09 11:09 PM

I can see absolutely NO benefits with plugin. Liferay is already overengineered with wrappers around Lucene which make extremely hard for instance to use multivalued non-tokenized "Tagged Content" (tags) field for "faceted search" (main selling point of SOLR).
Liferay, even 5.2.4 EE, has even bugs (some 'core' developers don't understand difference between Tokenizer implementations, and even use StringPool.BLANK during retrieval of plain text from Journal XML).

Why do we need _such_ SOLR? Isn't Lucene providing the same functionality?

Wow, you can even use SOLR sharding, and manage thread pools, funny...

Just create web-plugin with rich configuration options, and use SOLR as a completely separate engine (not for indexing Liferay's objects!)
For internal indexing of Liferay's objects plain Lucene is more than enough. Of course SOLR adds better configuration options: for instance you can configure different request handlers, different analyzers for the same field, and more, - but HOW to do it with overengineered Liferay's wrappers, and why do you wrap almost everything including Lucene?

Thanks

Fuad Efendi
6/20/09 11:11 PM

I can see absolutely NO benefits with plugin. Liferay is already overengineered with wrappers around Lucene which make extremely hard for instance to use multivalued non-tokenized "Tagged Content" (tags) field for "faceted search" (main selling point of SOLR).
Liferay, even 5.2.4 EE, has even bugs (some 'core' developers don't understand difference between Tokenizer implementations, and even use StringPool.BLANK during retrieval of plain text from Journal XML).

Why do we need _such_ SOLR? Isn't Lucene providing the same functionality?

Wow, you can even use SOLR sharding, and manage thread pools, funny...

Just create web-plugin with rich configuration options, and use SOLR as a completely separate engine (not for indexing Liferay's objects!)
For internal indexing of Liferay's objects plain Lucene is more than enough. Of course SOLR adds better configuration options: for instance you can configure different request handlers, different analyzers for the same field, and more, - but HOW to do it with overengineered Liferay's wrappers, and why do you wrap almost everything including Lucene?

Thanks

Fuad Efendi
6/20/09 11:22 PM

Ok, now I understand why:
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Pluggable+Enterp­rise+Search

- yes, separate Search Engine from Liferay Container is the main reason, and SOLR plugin is first and easiest step.

But again, instead of something 'abstract' let's do real staff, such as using _the_full_power_ of SOLR instead of focusing on minimal subset of features supported by any imaginable engine...

How do you handle multilingual support during indexing, for instance? Do you use language analyzers, word stemmers, synonym dictionaries for different languages? Do you provide SOLR with language attribute of the document? Do you 'analyze' user's query, and how? Stop-wrods for French?

Artur Linhart
9/8/09 1:13 AM

Hi, Fuad,

Your questions are very good... Bruno, can You answer them, please?

with best regards, Artur

Jonas Yuan
10/21/09 5:08 PM

Hi Fuad and Artur, good points - multilingual support? where is it? Can anyone answer them? Jonas

Carlos del Castillo
10/30/09 3:06 PM

Hello everybody, I just upgraded to Liferay 5.2.3. I installed the solr plugin 5.2.0.1 (backend solr is 1.3.0) and reindexed liferay. Everything went fine with the reindexing but when I try to do a search I get the following error:

21:55:29,229 ERROR [SolrIndexSearcherImpl:97] Error while sending request to Solr
java.lang.NullPointerException
at org.apache.solr.client.solrj.SolrQuery.toSortString(SolrQuery.java:497)
at org.apache.solr.client.solrj.SolrQuery.addSortField(SolrQuery.java:293)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:88)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:79)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:86)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:68)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:44)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:70)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­86)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
­at java.lang.Thread.run(Thread.java:619)
21:55:29,230 ERROR [SolrReaderMessageListener:47] Unable to process message {destination=liferay/search_reader, responseDestination=liferay/search_reader/response, responseId=a6a02f6d-b7e1-4faf-bd8a-557da69665e5, payload={command=SEARCH, companyId=10109, id=null, doc=null, query=+(+portletId:33) +(userName:test title:test content:test tagsEntries:test), sorts=[Lcom.liferay.portal.kernel.search.Sort;@1055900a, start=0, end=20}, values=null}
com.liferay.portal.kernel.search.SearchException: java.lang.NullPointerException
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:99)
at com.liferay.portal.search.solr.SolrSearchEngineUtil.search(SolrSearchEngineUtil.­java:79)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doCommandSear­ch(SolrReaderMessageListener.java:86)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.doReceive(Sol­rReaderMessageListener.java:68)
at com.liferay.portal.search.solr.messaging.SolrReaderMessageListener.receive(SolrR­eaderMessageListener.java:44)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­eListener.java:70)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestinatio­n.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­86)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
­at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at org.apache.solr.client.solrj.SolrQuery.toSortString(SolrQuery.java:497)
at org.apache.solr.client.solrj.SolrQuery.addSortField(SolrQuery.java:293)
at com.liferay.portal.search.solr.SolrIndexSearcherImpl.search(SolrIndexSearcherImp­l.java:88)
... 9 more
21:55:39,239 ERROR [jsp:1109] com.liferay.portlet.blogs.util.BlogsOpenSearchImpl com.liferay.portal.SystemException: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.messaging.MessageBusException: No reply received for message: {destination=liferay/search_reader, responseDestination=liferay/search_reader/response, responseId=a6a02f6d-b7e1-4faf-bd8a-557da69665e5, payload={command=SEARCH, companyId=10109, id=null, doc=null, query=+(+portletId:33) +(userName:test title:test content:test tagsEntries:test), sorts=[Lcom.liferay.portal.kernel.search.Sort;@1055900a, start=0, end=20}, values=null}

I'm using the global search tool. It only finds users and web content. But no blogs or wiki pages. (The query should return blog entries and wiki pages).


On the solr server side I only see this in the logs:

INFO: [] webapp=/solr path=/select params={fl=score&sort=displayDate+desc&start=0&q=%2B(%2BportletId:15)+%2B(title:­test+content:test+description:test+tagsCategories:test+tagsEntries:test+type:tes­t)&wt=javabin&rows=5&version=2.2} hits=9 status=0 QTime=1


Any ideas on how to fix this? Thanks

Thomas Kellerer
2/2/10 2:00 AM

Is there anyway to get a clustered search *without* using Solr?

We do not need a high-performance search, but we do need a cluster. But it seems Lucene/JDBC cannot be used....

Mayank Awasthi
2/19/10 5:48 AM

You need clusterd search result, i presume, If yes go for http://project.carrot2.org

If its a clustered search indexes then Solr is best you have.

Madhu Yadav
2/28/10 2:41 AM

check this post http://www.liferay.com/community/forums/-/message_boards/message/4662949

Dhrutika Parekh
4/30/10 12:41 PM

Hi,
I have same question...if you have answer..please reply..

How can we make sure its using solr search?
I am getting liferay serach results in solr admin console...but not sure how can sure thta liferay is using solr?

Carl Grimm
6/8/10 11:10 AM

We have not been able to use even the basic web interface with Solr because the results do have not a URL to get back to the document or page in Liferay.

How do we get SolrIndexWriterImpl to send URL for the given document over to Solr at index time?

Daniele Segato
6/23/10 9:14 AM

the schema.xml provided do not work with Sol-r 1.4.0 and the wiki page do not tell us which version of Sol-r we should use.

I get this error when starting the sol-r server with your schema.xml:

SEVERE: org.apache.solr.common.SolrException: no field name specified in query and no defaultSearchField defined in schema.xml

I've opened a thread in the forum:

http://www.liferay.com/community/forums/-/message_boards/message/5149946

Simon Fox
10/25/10 7:57 AM

Apologies if this isn't the correct area (please let me know!), but am looking into the situation where (when doing a "reindex all search indexes" inside liferay) the solr plugin creates a solr index of liferay pages which includes hidden pages. Can you advise on how to stop the hidden pages being included?

Thanks, Simon

Aaron Daubman
10/29/10 10:23 AM

How does one add search capabilities for data added to the database through a custom Portlet (or other not-currently-indexed portlets)?
This is for Solr 1.4.1 with Liferay EE 6.0.10.1

David García González
11/15/11 9:25 AM

Hi all!

Is this plugin supported for Liferay 6 EE?

Salva Tejero
12/1/11 3:31 AM

Hi, I've made several changes in this portlet. I needed suggestions for SOLR.
I've created a new implementation of Hits SolrHitsImpl and I've created a new attribute named "String[] suggestions; "
In the class SolrIndexSearcherImpl I've include this code

if(queryResponse.getSpellCheckResponse() != null){
List<Suggestion> suggestions = queryResponse.getSpellCheckResponse().getSuggestions();

List<String> sugerencias = new ArrayList<String>();
if(suggestions != null){
for(Suggestion sug: suggestions){
for(String s1 : sug.getSuggestions()){
if(!sugerencias.contains(s1)){
­ sugerencias.add(s1);
}
}
­ }
}
String[] suggestFinal = new String[sugerencias.size()];
subset.setSuggestions(sugerencias.toArray(sugge­stFinal));
}

I hope that it 's usefull

Henry K
2/24/12 7:36 AM

Solr integration seems to be broken in Liferay 6.1 GA 1. I get an error on deployment, and the context never loads.

INFO: Deploying web application directory /home/henryk/workspace/bundles/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.23/webapps­/solr-web
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [WebappClassLoader
context: /solr-web
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@73995d80
] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
context:
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@73995d80
].
log4j:ERROR­ Could not instantiate appender named "CONSOLE".
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/henryk/workspace/bundles/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.­23/temp/7-solr-web/WEB-INF/lib/slf4j-jdk14.jar!/org/slf4j/impl/StaticLoggerBinde­r.class]
SLF4J: Found binding in [jar:file:/home/henryk/workspace/bundles/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.­23/temp/7-solr-web/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.­class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
15:32:05,549 INFO [PluginPackageUtil:1099] Reading plugin package for solr-web
Loading file:/home/henryk/workspace/bundles/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.23/te­mp/7-solr-web/WEB-INF/classes/portlet.properties

Henry K
2/24/12 8:07 AM

Oh, this error is reported in http://issues.liferay.com/browse/LPS-9376 . Jonas's first post fixes the problem.

Victor E
3/2/12 1:39 AM

The interface for IndexWriter, IndexSearcher & SearchEngine changed in LF 6.1.
So it still wouldn't work after fixing the log4j.
Anyone had updated this for LF 6.1?