You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Murdoch, Paul" <PA...@saic.com> on 2010/03/24 19:38:13 UTC

Fields with the same name

Hi,

 

I have a quick question. If I have an index where some text values are
indexed under the same field name, but some are ANALYZED and some are
NOT_ANALYZED, does the last value's flags change the flags for the whole
field name?  For instance if I index 3 sentences under a field name as
ANALYZED and then index a 4th sentence as NOT_ANALYZED under the same
field name, are all 4 sentences now viewed as NOT_ANALYZED in the index?

 

Thanks,

 

Paul 

 


RE: Fields with the same name

Posted by "Murdoch, Paul" <PA...@saic.com>.
It was an unexpected coincidence that the two cases ended up with the
same field name.  I just changed the one case to index with a different
field name and that fixed my problem.  I was still curious though.

Thanks,

Paul 

-----Original Message-----
From: java-user-return-45558-PAUL.B.MURDOCH=saic.com@lucene.apache.org
[mailto:java-user-return-45558-PAUL.B.MURDOCH=saic.com@lucene.apache.org
] On Behalf Of Erick Erickson
Sent: Wednesday, March 24, 2010 4:28 PM
To: java-user@lucene.apache.org
Subject: Re: Fields with the same name

I don't think so, but a quick way to check would be to look at your
index with a copy of Luke and see what the actual tokens are.

But I'm not sure it matters, I don't think you *can* make things work
out well; your query-time analysis will be...er...difficult. You only
get to specify one analyzer per field, should it tokenize or not? Or
are you going to programmatically use different analyzers depending
upon some conditions? What if you want some of your tokens
analyzed and some not *in the same query* (e.g. several
OR clauses)? Or are you manually building up a BooleanQuery that's
"interesting"?

I think this will be a maintenance nightmare.

Why on earth would you want to do this anyway? Perhaps if you
described your use case we could suggest a better alternative.

Best
Erick

On Wed, Mar 24, 2010 at 2:38 PM, Murdoch, Paul
<PA...@saic.com>wrote:

> Hi,
>
>
>
> I have a quick question. If I have an index where some text values are
> indexed under the same field name, but some are ANALYZED and some are
> NOT_ANALYZED, does the last value's flags change the flags for the
whole
> field name?  For instance if I index 3 sentences under a field name as
> ANALYZED and then index a 4th sentence as NOT_ANALYZED under the same
> field name, are all 4 sentences now viewed as NOT_ANALYZED in the
index?
>
>
>
> Thanks,
>
>
>
> Paul
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Fields with the same name

Posted by Erick Erickson <er...@gmail.com>.
I don't think so, but a quick way to check would be to look at your
index with a copy of Luke and see what the actual tokens are.

But I'm not sure it matters, I don't think you *can* make things work
out well; your query-time analysis will be...er...difficult. You only
get to specify one analyzer per field, should it tokenize or not? Or
are you going to programmatically use different analyzers depending
upon some conditions? What if you want some of your tokens
analyzed and some not *in the same query* (e.g. several
OR clauses)? Or are you manually building up a BooleanQuery that's
"interesting"?

I think this will be a maintenance nightmare.

Why on earth would you want to do this anyway? Perhaps if you
described your use case we could suggest a better alternative.

Best
Erick

On Wed, Mar 24, 2010 at 2:38 PM, Murdoch, Paul <PA...@saic.com>wrote:

> Hi,
>
>
>
> I have a quick question. If I have an index where some text values are
> indexed under the same field name, but some are ANALYZED and some are
> NOT_ANALYZED, does the last value's flags change the flags for the whole
> field name?  For instance if I index 3 sentences under a field name as
> ANALYZED and then index a 4th sentence as NOT_ANALYZED under the same
> field name, are all 4 sentences now viewed as NOT_ANALYZED in the index?
>
>
>
> Thanks,
>
>
>
> Paul
>
>
>
>