You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Benjamin Higgins <bh...@gmail.com> on 2006/08/10 02:12:28 UTC
Advice on adding custom search operator that has special(?) characters
Hi all,
I want to add two search operators that require custom treatment because
they contain what I have found are special characters.
In one example, the operator takes a numeric job number that contains one
period, e.g. "jobnumber:2060250.00". I also have a "mainnumber" operator
that works the same way but doesn't take the decimal portion.
Trouble is, mainnumber queries works fine; jobnumber queries do not. The
code for both query filters are exactly the same, just with different
parameters to super:
public class JobNumberQueryFilter extends FieldQueryFilter {
public JobNumberQueryFilter() {
super("jobnumber");
}
}
So I am guessing that "." (period) is a special character that is either
being discarded by the indexer or is being parsed out at a higher level by
the query parser.
How can I get this to work?
Thanks all.
Ben
Re: Advice on adding custom search operator that has special(?) characters
Posted by Benjamin Higgins <bh...@gmail.com>.
Answering my own question: I switched from FieldQueryFilter to
RawFieldQueryFilter (additionally passing in 1.0f as the weight to super).
However, I also want to have a filter that will take phrases delimited by
quotes, and also a filter that can handle a colon appearing in the search
term.
So... new question: How can I do that? :)
On 8/9/06, Benjamin Higgins <bh...@gmail.com> wrote:
>
> Hi all,
>
> I want to add two search operators that require custom treatment because
> they contain what I have found are special characters.
>
> In one example, the operator takes a numeric job number that contains one
> period, e.g. "jobnumber:2060250.00". I also have a "mainnumber" operator
> that works the same way but doesn't take the decimal portion.
>
> Trouble is, mainnumber queries works fine; jobnumber queries do not. The
> code for both query filters are exactly the same, just with different
> parameters to super:
>
> public class JobNumberQueryFilter extends FieldQueryFilter {
> public JobNumberQueryFilter() {
> super("jobnumber");
> }
> }
>
> So I am guessing that "." (period) is a special character that is either
> being discarded by the indexer or is being parsed out at a higher level by
> the query parser.
>
> How can I get this to work?
>
> Thanks all.
>
> Ben
>