Re: 'wildcard search' without wildcards

Andreas Hartmann <[email protected]> Wed, 09 Jan 2013 17:17:23 +0100
Newsgroups gmane.comp.cms.lenya.user
Message-ID <[email protected]>
Hi David,

Am 09.01.13 15:24, schrieb David Richter:
> I am very new to Lenya and hope you can help me. I use Lenya in version
> 2.0.4 on an Apache Tomcat 6.0.36 server and I have two questions about
> the search function of Lenya.
>
> First
> Is there a way to change the search function, so that the 'wildcard
> search' also works without wildcards (without Java programming)? As if
> we were always search with using wildcardsat the end.
> For example: The search for "devel" would then deliver words like
> "developer" as a result. This currently only works with the use of
> wildcards... like this --> "devel*"

I doubt that this is possible without writing any code. Lenya uses 
Lucene for searching, with the standard Lucene query syntax.

http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_search_support_is_available_from_Lucene.3F

A simple workaround might be to use JavaScript to wrap each search term 
in wildcards before submitting the search form.

> Second
> For me, the search currently only works within a publication. Is there a
> way to search across all publications (also without Java programming)?

This should be possible by configuring a shared search index directory 
in all publications: <pub>/config/search/lucene-index.xml.

More info:
http://lenya.apache.org/docu20/tutorials/newPublication14.html#N100C5

Basically, instead of using the path

   lenya/pubs/$MYPUB/work/lucene/index

you could use something like

   /var/lenya/lucene/index

I would recommend to store all data (content, access control data, 
search index) outside the web application directory anyways.

HTH,
-- Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01