Facing problem with the FieldType of UniqueField

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Facing problem with the FieldType of UniqueField

rishabh9
Hi,

Initially, in my schema, I had my uniqueField's field type as "string" and
everything was working fine. But, then the users of my application wanted to
search on the unique field and entered values which were in a different case
than what was indexed. They never got proper results, at times, no results.

I noticed this happened because the field type was "string". I then changed
it to a custom text type and had specified only the whitespace tokenizer and
lowercase filter. It worked. The users were able to search on the
uniqueField irrespective of the case the values were entered in.

But now, another problem has risen. If I update a document, it really does
not update, but it is added as a separate document with the same uniqueField
value and the contents of the old document is merged with the new one.

So, now what I want to achieve is that the users should be able to search on
the uniqueField, irrespective of the case the values are entered in; and on
updation of a document, not to have duplicate documents (documents with the
same uniqueField value) in the index. Can anyone help me in as to how this
can be done?

Regards,
Rishabh
Reply | Threaded
Open this post in threaded view
|

Re: Facing problem with the FieldType of UniqueField

Ryan McKinley

> I noticed this happened because the field type was "string". I then changed
> it to a custom text type and had specified only the whitespace tokenizer and
> lowercase filter. It worked. The users were able to search on the

are there spaces in your unique key?  Try using the KeywordTokenizer --
the main concern with the field type for uniqueKey is to make sure it
only has one token.

ryan
Reply | Threaded
Open this post in threaded view
|

Re: Facing problem with the FieldType of UniqueField

rishabh9
Ryan,

Using the KeywordTokenizer does not help. And there are not any spaces in
the unique keys. the keys are alpha numeric. E.g.: AA-23-E1

Regards,
Rishabh

On Thu, Feb 14, 2008 at 10:28 PM, Ryan McKinley <[hidden email]> wrote:

>
> > I noticed this happened because the field type was "string". I then
> changed
> > it to a custom text type and had specified only the whitespace tokenizer
> and
> > lowercase filter. It worked. The users were able to search on the
>
> are there spaces in your unique key?  Try using the KeywordTokenizer --
> the main concern with the field type for uniqueKey is to make sure it
> only has one token.
>
> ryan
>
Reply | Threaded
Open this post in threaded view
|

Re: Facing problem with the FieldType of UniqueField

hossman

Bottomline: it's very hard to get everything right with having a uniqueKey
field that uses TextField.  if your goal is to let your users do case
insnsitive or "single word" queries on your uniqueKey field, just just
copyFiled to clone it into something more search friendly.


-Hoss