[TYPO3-Solr] Advanced search with SOLR

Ingo Renner ingo at typo3.org
Fri Aug 3 11:16:52 CEST 2012


Am 31.07.12 15:17, schrieb Christian Bleicher - DieLobby Werbeagentur Gmbh:

Hi Christian,

>> * To search specific fields simply query for fieldName:fieldValue. You
> might want to prefix the field internally so the user doesn't need to
> know the field names. You probably do not want/need to use filters.
>
> How does this work? If i try to search using the "q" parameter and type
> in "firstname_stringS:christian" He also finds people that match
> christian at lastname. It doesn't seem that SOLR takes care of the
> parameter. How does it work to query for 2 paramaters like firstname and
> lastname? "firstname:test AND lastname:test1"
>
> Should this work? If yes, I only need to prepare the query with
> javascript and send it to the backend then. That would be great.

You cannot do this using JS, rather you need to (as mentioned) switch 
the query to instruct Solr to use the standard request handler. This 
needs to be done on the PHP side.

See tx_solr_Query::setQueryType() and its phpDoc comment for a page on 
the Apache Solr wiki.

You can manipulate the query using the tx_solr_QueryModifier hook.


HTH
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code

TYPO3 - Open Source Enterprise Content Management System
http://typo3.org

Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com


More information about the TYPO3-project-solr mailing list