7

I need to run some searches in Tridion to find components which have 2 or more keywords. The GUI only allows me to specify one. The requirement is to store the search as a virtual folder so it can be used by content editors.

I was hoping to achieve this by creating a custom Lucene query, like this:

MyField:hello AND MyOtherField:world

However, this gives the error 'undefined field MyField'.

I did some digging around and found that all the content of an item is stored in one Lucene field called CatchAllXml. So this query works fine:

CatchAllXml:hello AND CatchAllXml:world

But obviously, this will return any item which contains the words 'hello' and 'world', regardless of the field. It is in fact synonymous to 'hello AND world'.

Does anyone know if it is possible to configure Tridion content fields as separate Lucene fields? Or is there another solution to this issue?

3 Answers 3

5

In TOM.NET you can use SearchQuery or SearchQueryData in CoreService which has BasedOnSchemas property which is a collection, you can set multiple values there. Or you could try:

SchemaId:? AND CatchAllXml:\"MyField hello MyField\" AND CatchAllXml:\"MyOtherField world MyOtherField\"
2
  • Good to know that the CoreService supports this, but that would not help me with my CME problem (without extending the GUI). I tried your suggestion but it doesn't return any results.
    – Quirijn
    Sep 11, 2013 at 13:34
  • Did you try without escaping the ". If this does not work try using SchemaId:? AND CatchAllXml:"MyField hello MyField"~1000000 AND CatchAllXml:"MyOtherField world MyOtherField"~1000000
    – Likhan
    Sep 11, 2013 at 13:42
3

It seems there is a very elegant way to do it, by modifying the Lucene configuration (schema.xml) and creating your own Search Index Handler. It is explained very thoroughly by Arjen Stobbe (http://80000ft.blogspot.nl/search/label/Search%20Indexing%20Handlers). We miss you, man..

1

Per my knowledge so far, you will only be able to search (through CME) based on TCMURI, Title (and few other standard field like item type etc.) and any search term as a whole in the complete component presentation. The Tridion SOLR schema suggests that complete component presentation along with meta information in the form of XML is stored in the the CatchAllXml field and then it has been used as a copy field in solr schema.

So from CME, I can not visualize a straight forward method per my knowledge.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.