Hi Sue,

 

Search analysis, filtering, stemming etc. is done by Apache Lucene, but there 
is a “DSAnalyzer” supplied by default with Dspace, The quickest way to achieve 
what you want may be to just comment out the steps you don’t want carried out 
in org.dspace.search.DSAnalyzer:

 

This function is the one you want to modify:

 

   /*

     * Create a token stream for this analyzer.

     */

    public final TokenStream tokenStream(String fieldName, final Reader reader)

    {

        TokenStream result = new DSTokenizer(reader);

 

        result = new StandardFilter(result);

        result = new LowerCaseFilter(result);

        result = new StopFilter(result, stopSet);

        result = new PorterStemFilter(result);  // THIS IS THE CALL TO THE 
STEMMER

 

        return result;

    }

 

The PorterStemFilter() call at the end is the stemmer you’re talking about, and 
the StopFilter ignores common conjunctions, pronouns etc. – I would recommend 
at least keeping the StandardFilter and LowerCaseFilter.

 

I haven’t tried exactly what you’re asking about, so I can’t guarantee results, 
but I have successfully added new filter steps without any hassles.

 

Cheers,

 

Kim

 

--

Kim Shepherd

IRR Technical Specialist

ITS Systems & Development

The University of Waikato

New Zealand

 

DDI +64 7 838 4025

 

 

 

From: Thornton, Susan M. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY] 
[mailto:susan.m.thorn...@nasa.gov] 
Sent: Wednesday, 9 September 2009 11:10 a.m.
To: dspace-tech@lists.sourceforge.net
Subject: [Dspace-tech] Can "Stemming" be turned off in DSpace Lucenesearches?

 

We are trying to figure out an easy way to turn off stemming in DSpace 
searches.  Can anyone point me in the right direction?

Thanks in advance,

Sue

 

 

Sue Walker-Thornton

ConITS Contract
NASA Langley Research Center
Integrated Library Systems Application & Database Administrator

130 Research Drive

Hampton, VA  23666

Office: (757) 224-4074
Fax:    (757) 224-4001
Pager: (757) 988-2547 
Email:  susan.m.thorn...@nasa.gov <mailto:susan.m.thorn...@nasa.gov> 

 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
  • [Dspac... Thornton, Susan M. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
    • R... Kim Shepherd

Reply via email to