Re: 'wildcard search' without wildcards
David Richter <[email protected]> Mon, 14 Jan 2013 10:10:11 +0100
| Newsgroups | gmane.comp.cms.lenya.user |
|---|---|
| Message-ID | <CAOoFXmHChrZ1a3egdNXj-MyQ_mYWBYPZ-LaE2N+_y+VsK9dm0g@mail.gmail.com> |
--047d7bfcf5242f223904d33c03b7 Content-Type: text/plain; charset=ISO-8859-1 Hi Andreas, thanks for your help. The javascript workaround works well. I still have a problem with the search across all publications. After I changed the path in the lucene_index.xml files for various publications, the search delivers no more results. I restarted the Tomcat already. The folder for the new path is created automatically in the file system and a file named 'segments' was created. In the original location (within the publications) are a few more files with the file extensions 'cfs' and 'del' and a file named 'deletable' ... I don't know how the files were created. I've noticed that the content of the folder determines which search results are displayed. Is there maybe a script that I have to start, so that all required files are generated? Or do I have to edit another configuration file? Thanks and regards, David 2013/1/9 Andreas Hartmann <[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<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<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 > > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: [email protected].**org<[email protected]> > For additional commands, e-mail: [email protected] > > --047d7bfcf5242f223904d33c03b7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><span id=3D"result_box" class=3D"" lang=3D"en"><span = class=3D"">Hi</span> <span class=3D"">Andreas</span><span class=3D"">,</spa= n><br class=3D""><span class=3D"">thanks for your help</span><span class=3D= "">.</span> <span class=3D"">The javascript</span> <span class=3D"">workaro= und</span> <span class=3D"">works well.</span><br class=3D""> <br class=3D""><span class=3D"">I still have</span> <span class=3D"">a prob= lem with the </span></span>search across all publications<span id=3D"result= _box" class=3D"" lang=3D"en"><span class=3D"">.</span><br class=3D""><span = class=3D"">After</span> <span class=3D"">I changed</span> <span class=3D"">= the path in</span> <span class=3D"">the</span> <span class=3D"">lucene_inde= x.xml</span> <span class=3D"">files for</span> <span class=3D"">various</sp= an> <span class=3D"">publications</span><span class=3D"">,</span> <span cla= ss=3D"">the</span> <span class=3D"">search</span> delivers <span class=3D""= >no more results</span><span class=3D"">.</span> </span><span id=3D"result_= box" class=3D"" lang=3D"en"><span id=3D"result_box" class=3D"" lang=3D"en">= </span><span id=3D"result_box" class=3D"" lang=3D"en"><span class=3D"">I re= started the</span> <span class=3D"">Tomcat</span> <span class=3D"">already<= /span><span class=3D"">.</span></span><span id=3D"result_box" class=3D"" la= ng=3D"en"></span><span class=3D""> The folder for the new path</span> <span= class=3D"">is created</span> <span class=3D"">automatically</span> <span c= lass=3D"">in the file system</span> <span class=3D"">and a</span> <span cla= ss=3D"">file named 'segments</span><span class=3D""></span><span class= =3D"">'</span> <span class=3D"">was created.</span> <span class=3D"">In= the original location</span> <span class=3D"">(</span><span class=3D"">wit= hin the</span> <span class=3D"">publications</span><span class=3D"">)</span= > <span class=3D"">are</span> <span class=3D"">a few more </span><span clas= s=3D"">files with the file extension</span>s <span class=3D"">'cfs</spa= n>' <span class=3D"">and</span> <span class=3D"">'del</span>' <= span class=3D"">and</span> a file named '<span class=3D""></span><span = class=3D"">deletable'</span><span class=3D""></span> <span class=3D"">.= ..</span> <span class=3D"">I</span> don't<span class=3D""> know</span> = <span class=3D"">how</span> <span class=3D"">the files</span> <span class= =3D"">were created</span><span class=3D"">.</span> <span class=3D"">I'v= e noticed</span> <span class=3D"">that the content</span> <span class=3D"">= of the folder</span> <span class=3D"">determines which</span> <span class= =3D"">search results are displayed</span><span class=3D"">.</span> </span><= span id=3D"result_box" class=3D"" lang=3D"en"><br> <br class=3D""><span class=3D"">Is there</span> <span class=3D"">maybe</spa= n> <span class=3D"">a script</span> <span class=3D"">that</span> <span clas= s=3D"">I have to</span> <span class=3D"">start</span><span class=3D"">, so = that all</span> <span class=3D"">required files are</span> <span class=3D""= >generated</span><span class=3D"">? </span></span><span id=3D"result_box" c= lass=3D"" lang=3D"en"><span class=3D""><span id=3D"result_box" class=3D"" l= ang=3D"en"><span class=3D"">Or</span> <span class=3D"">do I have to</span> = <span class=3D"">edit</span> <span class=3D"">another configuration file</s= pan></span>?<br> <br></span></span></div><span id=3D"result_box" class=3D"" lang=3D"en"><spa= n class=3D"">Thanks and regards, David<br></span></span></div><div class=3D= "gmail_extra"><br><br><div class=3D"gmail_quote">2013/1/9 Andreas Hartmann = <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blan= k">[email protected]</a>></span><br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Hi David,<br> <br> Am 09.01.13 15:24, schrieb David Richter:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"im"> I am very new to Lenya and hope you can help me. I use Lenya in version<br> 2.0.4 on an Apache Tomcat 6.0.36 server and I have two questions about<br> the search function of Lenya.<br> <br> First<br> Is there a way to change the search function, so that the 'wildcard<br> search' also works without wildcards (without Java programming)? As if<= br></div> we were always search with using wildcardsat the end.<div class=3D"im"><br> For example: The search for "devel" would then deliver words like= <br> "developer" as a result. This currently only works with the use o= f<br> wildcards... like this --> "devel*"<br> </div></blockquote> <br> I doubt that this is possible without writing any code. Lenya uses Lucene f= or searching, with the standard Lucene query syntax.<br> <br> <a href=3D"http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_searc= h_support_is_available_from_Lucene.3F" target=3D"_blank">http://wiki.apache= .org/lucene-<u></u>java/LuceneFAQ#What_wildcard_<u></u>search_support_is_av= ailable_<u></u>from_Lucene.3F</a><br> <br> A simple workaround might be to use JavaScript to wrap each search term in = wildcards before submitting the search form.<div class=3D"im"><br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Second<br> For me, the search currently only works within a publication. Is there a<br= > way to search across all publications (also without Java programming)?<br> </blockquote> <br></div> This should be possible by configuring a shared search index directory in a= ll publications: <pub>/config/search/lucene-<u></u>index.xml.<br> <br> More info:<br> <a href=3D"http://lenya.apache.org/docu20/tutorials/newPublication14.html#N= 100C5" target=3D"_blank">http://lenya.apache.org/<u></u>docu20/tutorials/<u= ></u>newPublication14.html#N100C5</a><br> <br> Basically, instead of using the path<br> <br> =A0 lenya/pubs/$MYPUB/work/lucene/<u></u>index<br> <br> you could use something like<br> <br> =A0 /var/lenya/lucene/index<br> <br> I would recommend to store all data (content, access control data, search i= ndex) outside the web application directory anyways.<br> <br> HTH,<br> -- Andreas<span class=3D"HOEnZb"><font color=3D"#888888"><br> <br> -- <br> Andreas Hartmann, CTO<br> BeCompany GmbH<br> <a href=3D"http://www.becompany.ch" target=3D"_blank">http://www.becompany.= ch</a><br> Tel.: <a href=3D"tel:%2B41%20%280%29%2043%20818%2057%2001" value=3D"+414381= 85701" target=3D"_blank">+41 (0) 43 818 57 01</a><br> <br> <br> ------------------------------<u></u>------------------------------<u></u>-= --------<br> To unsubscribe, e-mail: <a href=3D"mailto:[email protected]= " target=3D"_blank">[email protected].<u></u>org</a><br> For additional commands, e-mail: <a href=3D"mailto:[email protected]= rg" target=3D"_blank">[email protected]</a><br> <br> </font></span></blockquote></div><br></div> --047d7bfcf5242f223904d33c03b7--