[opencms-dev] Simple Search 1.4 with user name in the search field produces strange results

M Butcher mbutcher at grcomputing.net
Fri Nov 21 06:44:01 CET 2003


I would guess that the string 'admin' appears somewhere in the HTML for 
those pages (perhaps in a comment or meta tag). As far as indexing goes, 
author is not an indexed field (see 
net.grcomputing.opencms.search.lucene.PageDocument), so it is unlikely 
that you are getting that data from the wrong index.

Matt

Trevor Lee wrote:
> Hi,
> 
> I was wondering whether anyone else has experienced the problem with simple
> search (using lucene 1.4) where entering a user name eg. "admin" and search
> on that. It returns all articles created by admin in this instance.
> I've prefixed the term with "body:".
> 
> What could be causing this behaviour?
> 
> the doSimpleSearch() method is the one below (as in SearchHelper.java):
> 
> I've included my registry file below....
> 	public Hits doSimpleSearch(String term) throws CmsException {
> 		try {
> 			Searcher s = new IndexSearcher(getIndexPath());
> 			Query q = null;
> 			Analyzer analyzer = new StopAnalyzer();
> 
> 			q = QueryParser.parse(term, FIELD_BODY, analyzer);
> 			Hits hits = s.search(q);
> 			return hits;
> 		} catch (java.io.IOException ioe) {
> 			throw new CmsException("Error searching", ioe);
> 		} catch (org.apache.lucene.queryParser.ParseException pe) {
> 			throw new CmsException("Error parsing search string", pe);
> 		}
> 	}
> 
> Registry.xml
>         <luceneSearch>
>             <mergeFactor>100000</mergeFactor>
>             <permCheck>true</permCheck>
> 
> <indexDir>C:\Jakarta-Tomcat-4.1.12\webapps\opencms\lucene\index\</indexDir>
> 
> <analyzer>org.apache.lucene.analysis.standard.StandardAnalyzer</analyzer>
>             <subsearch>true</subsearch>
>             <project>online</project>
>             <docFactories>
>                 <docFactory enabled="true" type="page">
> 
> <class>net.grcomputing.opencms.search.lucene.PageDocument</class>
>                 </docFactory>
>                 <docFactory enabled="true" type="plain">
>                     <fileType name="plaintext">
>                         <extension>.txt</extension>
> 
> <class>net.grcomputing.opencms.search.lucene.PlainDocument</class>
>                     </fileType>
>                     <fileType name="taggedtext">
>                         <extension>.html</extension>
>                         <extension>.htm</extension>
>                         <extension>.xml</extension>
>                         <!-- This will strip tags before processing -->
> 
> <class>net.grcomputing.opencms.search.lucene.TaggedPlainDocument</class>
>                     </fileType>
>                 </docFactory>
>                 <docFactory enabled="true" type="binary">
> 
> <class>net.grcomputing.opencms.search.lucene.BodylessDocument</class>
>                 </docFactory>
>                 <docFactory enabled="true" type="jsp">
> 
> <class>net.grcomputing.opencms.search.lucene.JspDocument</class>
>                 </docFactory>
>                 <docFactory enabled="true" type="news">
> 
> <class>net.grcomputing.opencms.search.lucene.NewsDocument</class>
>                 </docFactory>
>                 <docFactory enabled="false" type="XML Template"/>
>             </docFactories>
>             <directories>
>                 <directory location="/SWM/">
>                     <section>Test</section>
>                     <subsearch>true</subsearch>
>                 </directory>
>             </directories>
>             <contentDefinitions>
>                 <contentDefinition type="news">
> 
> <class>com.opencms.modules.homepage.news.NewsContentDefinition</class>
> 
> <initClass>net.grcomputing.opencms.search.lucene.NewsInitialization</initCla
> ss>
>                     <listMethod name="getSortedList">
>                         <param type="java.lang.String"/>
>                     </listMethod>
>                     <page uri="/SoftwareMark/auth/news/news.jsp">
>                         <param method="getIntId" name="id"/>
>                     </page>
>                 </contentDefinition>
>             </contentDefinitions>
>         </luceneSearch>
> 
> Thank you
> Trevor
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list