[opencms-dev] Simple Search 1.4 with user name in the search field produces strange results
Trevor Lee
Trevor.Lee at 4Loop.com.au
Fri Nov 21 07:05:03 CET 2003
Hi Matt,
Thanks. I've checked the content and there isn't anything in the body that
has admin.
However i did notice that all the search results are from news articles
created by the Admin user.
I created an article as another user - "user1" with and did a search for
"user1" and the results returned the article that was just created.
I'm using the attached version of News 2.1 and Lucene 1.4.
If someone could help with this that would be good as my deadline is
approaching.
Cheers
Trevor
-----Original Message-----
From: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org]On Behalf Of M Butcher
Sent: Friday, November 21, 2003 4:50 PM
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] Simple Search 1.4 with user name in the
search field produces strange results
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
_______________________________________________
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: com.opencms.modules.homepage.news_2.1.zip
Type: application/x-zip-compressed
Size: 53459 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20031121/92b4579d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: net.grcomputing.opencms.search.lucene_1.4.zip
Type: application/x-zip-compressed
Size: 170847 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20031121/92b4579d/attachment-0001.bin>
More information about the opencms-dev
mailing list