On 9/9/2010 5:38 PM, Erick Erickson wrote:
Could you give us an idea of why you think it isn't present? As far as I can
tell,
it's been around for a while. Are you getting an error and if so, can you
show it
to us?

Look in schema.xml of what you downloaded (probably in the example
directory).
Is it mentioned there? If so, it should "just be there" but do note that I'm
looking at
the latest trunk version.

Best
Erick

On Thu, Sep 9, 2010 at 6:55 PM, Andrew Cogan<aco...@wordsearchbible.com>wrote:

I didn't build SOLR, I downloaded a prebuilt zip file. Am I correct in my
understanding that the charFilter class PatternReplaceCharFilterFactory is
not part of the prebuilt SOLR 1.4.1 distribution? If that's right, how do I
go about adding it? The more explicit the instructions the better, as I
have
no prior Java experience.


The one called PatternReplaceFilterFactory (no Char) has been around forever. It is not mentioned on the Wiki page about analyzers. The one called PatternReplaceCharFilterFactory is only available from svn.

I found that the CharFilter version paid no attention to the place in my analyzer where it was defined, it went first, even before the tokenizer. Furthermore, it didn't actually work, even if I used a simple search and replace, it completely ate my source string and nothing went into the index. Here's what I ended up going with, which works with a completely unmodified 1.4.1 warfile:

<filter class="solr.PatternReplaceFilterFactory"
          pattern="^(\p{Punct}*)(.*?)(\p{Punct}*)$"
          replacement="$2"
        />

Thanks,
Shawn

Reply via email to