Share » Learn » eZ Publish » Advanced development with eZ Find -...

Advanced development with eZ Find - part 1 : Datatypes in Solr and eZ Find

Monday 07 June 2010 8:05:08 am

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Step 1 : how to speed-up eZ Find development tasks : tips & tricks

The following tips will make development on eZ Find more comfortable, and also significantly increase your speed as a developer, and the quality of the output work.

Re-index some content after a modification

Re-indexing all content to merely test one single, minor modification's impact on one's application can quickly become a drawn-out process. A few, hidden, life-saver arguments exist in the concerned script /bin/php/updatesearchindexsolr.php, allowing for pointing to:

  • a root node
  • an offset
  • a limit

It is mandatory to use the 3 parameters simultaneously :

php extension/ezfind/bin/php/updatesearchindexsolr.php --siteaccess=mysiteaccess --topNodeID=2546 --offset=0 --limit=10

Check what Solr actually indexed

Solr Web administration

Solr Web administration

 

In order to check whether the content and its attributes were properly indexed, simply search for them in Solr's Web administration : http://localhost:8983/solr/admin/. This interface will also help you figure how the Solr fields were named. For instance, when using the 2.2 version of eZ Find, one can observe two fields looking like duplicates when it comes to articles' titles :

  • attr_title_s
  • attr_title_t

The rest of the tutorial explains this behaviour.

Debugging directly in Solr

By leaving an active console opened, you will be able to view all messages sent to Solr, of the following form :

INFO: [] webapp=/solr path=/select params={ ... MESSAGE ... } status=400 QTime=5

Solr output in an active console

Solr output in an active console

 

This message can be copied and pasted from the console to the end of the URL, in Solr's administration interface : http://localhost:8983/solr/select/?MESSAGE. The obtained result is the exact output sent by Solr to eZ Find before transformation and display of the results. Using this trick is pretty useful when debugging, by, for example, directly manipulating the messages to retrieve the expected result.

 

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)