lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shivashankar Maddanimath <>
Subject RE: Can we configure analyzers to not exclude specific characters
Date Thu, 29 Jan 2015 20:36:14 GMT
Thanks Michael,

I am using lucene library so below I how I used your suggestion. Its works but if I need to
add multiple patterns and replacements then its not working. It picks the last entry. Is there
any way we can add multiple patterns and replacements to PatternReplaceCharFilterFactory?

TokenStream ts;
        Map ruleExplained = new HashMap();
        ruleExplained.put("pattern", "([cC])\\+\\+");
        ruleExplained.put("replacement", "CPlusPlus");
        PatternReplaceCharFilterFactory myRules = new PatternReplaceCharFilterFactory(ruleExplained);

        Reader myreader = myRules.create(new BufferedReader(new InputStreamReader(new    
        ts = new UAX29URLEmailTokenizer(Version.LUCENE_48,myreader);


-----Original Message-----
From: "Michael Sokolov" <>
Sent: ‎29-‎01-‎2015 01:32 AM
To: "" <>
Subject: Re: Can we  configure  analyzers to not exclude specific characters

It's a bit of a hack, but we do this:

         <charFilter class="solr.PatternReplaceCharFilterFactory" 
pattern="([A-Za-z])\+\+" replacement="$1plusplus" />
         <charFilter class="solr.PatternReplaceCharFilterFactory" 
pattern="([A-Za-z])\#" replacement="$1sharp" />

On 1/28/2015 2:00 AM, Shivashankar Maddanimath wrote:
> Hi,
> I am using  Lucene standard and uax29urlemailtokenizer. These analysers are excluding
some characters like "+" ( I can't search C++). Is there any way we can  configure analyzers
to include specific characters in analyzers while tokenising?
> Regards,
> Shiv
> -----Original Message-----
> From: "Luis A Lastras" <>
> Sent: ‎25-‎01-‎2015 08:05 AM
> To: "" <>
> Subject: Absolute term position in scoring
> Is it possible to incorporate in Lucene's scoring function the position of a matching
term (say as measured from the top of the document). The scenario is, if the set of documents
tend to lk about the most important stuff at the beginning of the document, then we would
like to give preference to documents that mention a term close to the top.
> Thanks,
> Luis
> Luis A Lastras, Ph.D.
> Research Staff Member & Manager, Concept Analytics, IBM Watson
> Member of the iBM Academy of Technology
> IBM Master Inventor
> email: | Tel: 914-945-3613 | Cell: 914-382-1879
> address:  1101 Kitchawan Rd, Office 28-132, Yorktown Heights, NY, 10598

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message