problem in setting field attribute in schema.xml

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

problem in setting field attribute in schema.xml

Romi
In my schema.xml file i made a filed attribute indexed=false and stored=true.
ie. i am not indexing this field but still in my search results i am getting values for this field, why is so any idea?
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
Please reply, i am not getting any of my problems reply in this forum.
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

bryan rasmussen
In reply to this post by Romi
if you never want to see a result for a field set stored = false.

Best Regards,
Bryan Rasmussen

On Wed, May 25, 2011 at 2:37 PM, Romi <[hidden email]> wrote:

> In my schema.xml file i made a filed attribute indexed=false and stored=true.
> ie. i am not indexing this field but still in my search results i am getting
> values for this field, why is so any idea?
>
> -----
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-schema-xml-tp2984126p2984126.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
if i do stored=false then it indexes the data but not shows the data in search result. but in my case i do not want to index the data for a field and to the my surprise even if i am doing indexed="false" for this field, i am still able to get that data through the query *:* but not getting the data if i run filter query as field:value, its really confusing what solr is doing.
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

bryan rasmussen
surely it indexes the data if you do indexed = true.

if you put some data in the field that is unique to that document and
then search do you get it? If not then it is because it is not
indexed. If you do a search for another field in the same document but
still get the non-indexed field shown it is because the non-indexed
field is stored.

Best Regards,
Bryan Rasmussen

On Wed, May 25, 2011 at 3:11 PM, Romi <[hidden email]> wrote:

> if i do stored=false then it indexes the data but not shows the data in
> search result. but in my case i do not want to index the data for a field
> and to the my surprise even if i am doing indexed="false" for this field, i
> am still able to get that data through the query *:* but not getting the
> data if i run filter query as field:value, its really confusing what solr is
> doing.
>
> -----
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-schema-xml-tp2984126p2984239.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
If i do uniqueField to indexed="false" then it shows the exception

org.apache.solr.common.SolrException: Schema Parsing Failed


and in http://wiki.apache.org/solr/SchemaXml#Fields it is clearly mentioned that a non-indexed field is not searchable then why i am getting search result. why should stored="true" matter if indexed="false"
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Yury Kats
On 5/25/2011 9:29 AM, Romi wrote:
> and in http://wiki.apache.org/solr/SchemaXml#Fields it is clearly mentioned
> that a non-indexed field is not searchable then why i am getting search
> result. why should stored="true" matter if indexed="false"

"indexed" controls whether you can find the document based on the content of this field.
"stored" controls whether you will see the content of this field in the result.

Reply | Threaded
Open this post in threaded view
|

RE: problem in setting field attribute in schema.xml

Vignesh Raj
In reply to this post by Romi
It's very strange. Even I tried the same now and am getting the same result.
I have set both indexed=false and stored=false.
But still if I search for a keyword using my default search, I get the
results in these fields as well.
But if I specify field:value, it shows 0 results.

Can anyone explain?

Regards
Vignesh


-----Original Message-----
From: Romi [mailto:[hidden email]]
Sent: 25 May 2011 18:42
To: [hidden email]
Subject: Re: problem in setting field attribute in schema.xml

if i do stored=false then it indexes the data but not shows the data in
search result. but in my case i do not want to index the data for a field
and to the my surprise even if i am doing indexed="false" for this field, i
am still able to get that data through the query *:* but not getting the
data if i run filter query as field:value, its really confusing what solr is
doing.

-----
Romi
--
View this message in context:
http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-sch
ema-xml-tp2984126p2984239.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Jan Høydahl / Cominvent
You probably get tricked by an old index which was created while you had stored=true

Delete your index, restart Solr, re-index content and try again.

Solr will happily serve what's in the Lucene index even if it does not match your current schema - that's why it's important to re-index everything if you make changes to the schema and you want those changes to be visible.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 25. mai 2011, at 15.47, Vignesh Raj wrote:

> It's very strange. Even I tried the same now and am getting the same result.
> I have set both indexed=false and stored=false.
> But still if I search for a keyword using my default search, I get the
> results in these fields as well.
> But if I specify field:value, it shows 0 results.
>
> Can anyone explain?
>
> Regards
> Vignesh
>
>
> -----Original Message-----
> From: Romi [mailto:[hidden email]]
> Sent: 25 May 2011 18:42
> To: [hidden email]
> Subject: Re: problem in setting field attribute in schema.xml
>
> if i do stored=false then it indexes the data but not shows the data in
> search result. but in my case i do not want to index the data for a field
> and to the my surprise even if i am doing indexed="false" for this field, i
> am still able to get that data through the query *:* but not getting the
> data if i run filter query as field:value, its really confusing what solr is
> doing.
>
> -----
> Romi
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-sch
> ema-xml-tp2984126p2984239.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Michael Lackhoff-2
In reply to this post by Vignesh Raj
Am 25.05.2011 15:47, schrieb Vignesh Raj:
> It's very strange. Even I tried the same now and am getting the same result.
> I have set both indexed=false and stored=false.
> But still if I search for a keyword using my default search, I get the
> results in these fields as well.
> But if I specify field:value, it shows 0 results.
>
> Can anyone explain?

I guess you copy the field to your default search field.

-Michael
Reply | Threaded
Open this post in threaded view
|

RE: problem in setting field attribute in schema.xml

Vignesh Raj
In reply to this post by Jan Høydahl / Cominvent
I tried deleting the index and trying it again. But still I get the same
result.

Regards
Vignesh

-----Original Message-----
From: Jan Høydahl [mailto:[hidden email]]
Sent: 25 May 2011 19:30
To: [hidden email]
Subject: Re: problem in setting field attribute in schema.xml

You probably get tricked by an old index which was created while you had
stored=true

Delete your index, restart Solr, re-index content and try again.

Solr will happily serve what's in the Lucene index even if it does not match
your current schema - that's why it's important to re-index everything if
you make changes to the schema and you want those changes to be visible.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 25. mai 2011, at 15.47, Vignesh Raj wrote:

> It's very strange. Even I tried the same now and am getting the same
result.

> I have set both indexed=false and stored=false.
> But still if I search for a keyword using my default search, I get the
> results in these fields as well.
> But if I specify field:value, it shows 0 results.
>
> Can anyone explain?
>
> Regards
> Vignesh
>
>
> -----Original Message-----
> From: Romi [mailto:[hidden email]]
> Sent: 25 May 2011 18:42
> To: [hidden email]
> Subject: Re: problem in setting field attribute in schema.xml
>
> if i do stored=false then it indexes the data but not shows the data in
> search result. but in my case i do not want to index the data for a field
> and to the my surprise even if i am doing indexed="false" for this field,
i
> am still able to get that data through the query *:* but not getting the
> data if i run filter query as field:value, its really confusing what solr
is
> doing.
>
> -----
> Romi
> --
> View this message in context:
>
http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-sch
> ema-xml-tp2984126p2984239.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
In reply to this post by Yury Kats
"indexed" controls whether you can find the document based on the content of this field.
"stored" controls whether you will see the content of this field in the result.


ya...but when i set indexed="false" for a particular field, and i search as *:* then it will search all documents thats true, but what i think is it should not contain the field which i set as indexed="true".
for example in a document fields are id, author,title. and i for author field i set indexed="false", then author should not be indexed and when i perform search  as *:* it should show all documents as
<doc>
<string name= "id"> id1</string>
<string name="title">t1</string>
<string name="author">a1</string>
</doc> 

but if i search author:a1, then 0 result will be found, why so?? to be very clear i am performing full-import where every time new indexes are created then also for safer side i deleted the indexes and recreated them then too i am facing the same problem.
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
In reply to this post by Michael Lackhoff-2
even though i am running command for full-import, then also i deleted old indexes , re created indexes, i am not using defaultSearchFiled and copyingField attribute, still i am getting the search result for the field which i set as indexed="true", really strange, please help me to get rid of this problem. Thanks.
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

bryan rasmussen
In reply to this post by Romi
> ya...but when i set indexed="false" for a particular field, and i search as
> *:* then it will search all documents thats true, but what i think is it
> should not contain the field which i set as indexed="true".
> for example in a document fields are id, author,title. and i for author
> field i set indexed="false", then author should not be indexed and when i
> perform search  as *:* it should show all documents as
> <doc>
> <string name= "id"> id1</string>
> <string name="title">t1</string>
> <string name="author">a1</string>
> </doc>

Well, since I am only a beginner myself I have to say what my
experience is - given that I have cleared my index, restarted,
reindexed with new schema settings and do a restart (which is probably
overdone)
and if the schema I indexed with says indexed = false, stored=true for
author and I search for author:a1 then I will get 0 results as I
expect and if I search for id:id1 then it will show
 <doc>
 <string name= "id"> id1</string>
 <string name="title">t1</string>
 <string name="author">a1</string>
 </doc>
as  I expect - is this what is happening for you?

if it is happening and you are confused as to why I can't answer why
on a technical level as I assume it is based on design decisions which
I would agree don't seem sensible to me but is very probably based on
some underlying technical reason that I am not familiar with.

If you want to make sure that you do only see id and title in your
result then either set stored = false for author (although why would
you have a field that was both not stored and not indexed I don't
know) or use the fl parameter on your request to give the list of
fields you want returned - for example &fl=id,title in the querystring
for the request should mean you would just see
<string name= "id"> id1</string>
 <string name="title">t1</string>
and not
 <string name="author">a1</string>

Best Regards,
Bryan Rasmussen
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
thanks a lot bryan: it might be again the repetition, but i just want to know WHY it is indexing the field when it is indexed="false", what if stored="true", it is clearly written in documentation that a field is search able only if it is indexed="true", which surely make sense.
and my application is not saying to do so i am just experimenting with solr to learn it. want to clear my concepts about indexing.

Thanks
Romi
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

bryan rasmussen
From my experience if it is indexing content that you have told it not
to index that is because you haven't cleared your old indexed content.
If you index something using schema version 5 which says indexed =
true and then you change it to indexed = false you have to delete your
old indexed content and reindex using the new schema, with lots of
stopping and restarting involved.

So - delete index, restart with new schema, index content with new schema.

Best Regards,
Bryan Rasmussen

On Thu, May 26, 2011 at 11:24 AM, Romi <[hidden email]> wrote:

> thanks a lot bryan: it might be again the repetition, but i just want to know
> WHY it is indexing the field when it is indexed="false", what if
> stored="true", it is clearly written in documentation that a field is search
> able only if it is indexed="true", which surely make sense.
> and my application is not saying to do so i am just experimenting with solr
> to learn it. want to clear my concepts about indexing.
>
> Thanks
> Romi
>
> -----
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-schema-xml-tp2984126p2988066.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
i deleted my index but what do u mean by restart with new schema??
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

bryan rasmussen
Well I'm probably being overly cautious here but its been my
experience that if I have a schema that says indexed = true on a field
and I change it to indexed = false I have to delete my index to get
rid of everything that was indexed with the old schema and I have to
restart to be able to index with the new schema.

I've had the situation a number of times where I have changed the
indexing rule for a field and not followed these steps and been
surprised when my index does not follow my expectations - and it seems
like you are experiencing the same thing.

Best Regards,
Bryan Rasmussen
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Romi
i have done it, i deleted old indexes and created new indexes but still able to search it through *:*, and no result when i search it as field:value. really surprising result. :-O
Thanks & Regards Romi
Reply | Threaded
Open this post in threaded view
|

Re: problem in setting field attribute in schema.xml

Chandan Tamrakar-2
I guess you are indexing with  property index=false ,  stored = true
if  it  is  , that means you are storing the value on "index"  , so whenever
you do *:*  you can see the stored value

for example

 if you have a field = ID, Customer_Name   and you would only like to index
"customer_name" because this is a field which users is going to search ..
then you can just store "ID" in index without indexing .

When  customer names matches your index you would also like to show "ID" to
users

I do not know what is the purpose on your case  . Store fields are usually
required when you don't want to index  but show on the search results.

I hope its clear  . You can try and experiment changing these values on a
unique fields too ..

thanks.






On Thu, May 26, 2011 at 4:37 PM, Romi <[hidden email]> wrote:

> i have done it, i deleted old indexes and created new indexes but still
> able
> to search it through *:*, and no result when i search it as field:value.
> really surprising result. :-O
>
> -----
> Romi
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/problem-in-setting-field-attribute-in-schema-xml-tp2984126p2988256.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Chandan Tamrakar
*
*
12