I am trying to create a custom search component, that will make search queries for different indexes. This component redirects the URL to the default search component for the queries.
On the default search component, it normally searches the “SearchableText” index, and this query returns the results even if the keyword is written partially.
Example URL: /search?SearchableText=testpage Result: returns also the page with name “test”
But if I search other indexes, it only returns the correct results if the full name of the index is written.
If I am searching for an object named ‘testobject’; Example URL: /search?SearchableText=&objectName=test Result: Doesn’t return unrelated results
Example URL: /search?SearchableText=&objectName=testobject Result: Returns the correct result.
Has anyone tackled with this problem before?
Is this related to the index's meta type?
If so, which type of index type should I use, if not, how can I achieve this?
SearchableText indexer is a fulltext search index (ZCTextIndex internally) which collects arbitrary data from your object (title, description, text, keywords etc ...) and it can be extended with AND and OR and * for searching parts of words.
KeywordIndex indexes and searches for the exact words (eg. Subject).
EDIT: you can see what's indexed in the catalog if you go to portal_catalog/Catalog tab and click on the path in the list below. There you see the Index Contents for searching and Metadata Contents which is returned by the catalog brain.