You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Spadez <ja...@hotmail.com> on 2012/09/20 14:38:14 UTC

ID reference field - Needed but not searchable or retrievable

Hi.

My SQL database assigns a uniqueID to each item. I want to keep this
uniqueID assosiated to the items that are in Solr even though I wont ever
need to display them or have them searchable. I do however what to be able
to target specific items in Solr with it, for updating or deleting the
record.

Right now I have this in my schema:
<field name="id" type="string" indexed="true" stored="true"/>

However, since I dont want it searchable or stored it should be this:
<field name="uniqueid" type="string" indexed="false" stored="false"/>

Firstly, is this the correct way of doing this? I saw mention of a "ignore"
attibute that can be added.

Secondly, if I wanted to do updates to the fields using JSON by targetting
the uniqueID can I still do something like this:
"delete": { "uniqueid":"7" },                               /* delete entry
uniqueID=7 */

Thank you for any help you can give. Hope I explained it well enough.

James



--
View this message in context: http://lucene.472066.n3.nabble.com/ID-reference-field-Needed-but-not-searchable-or-retrievable-tp4009162.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: ID reference field - Needed but not searchable or retrievable

Posted by Spadez <ja...@hotmail.com>.
Thank you, I think ill just index it for simplicity



--
View this message in context: http://lucene.472066.n3.nabble.com/ID-reference-field-Needed-but-not-searchable-or-retrievable-tp4009162p4009187.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: ID reference field - Needed but not searchable or retrievable

Posted by Tom Mortimer <to...@gmail.com>.
Hi James,

If you don't want this field to be included in user searches, just omit it from the search configuration (e.g. if using eDisMax parser, don't put it in the qf list). To keep it out of search results, exclude it from the fl list. See

	http://wiki.apache.org/solr/CommonQueryParameters
and
	http://wiki.apache.org/solr/ExtendedDisMax

The overhead from storing it will most likely be very small, and as Micheal points out it means you could potentially reference documents both ways.

Not sure about the JSON question, but in XML "<delete><query>uniqueID:7</query></delete>" would remove the whole doc, not just the uniqueID field. 

Tom


On 20 Sep 2012, at 13:38, Spadez <ja...@hotmail.com> wrote:

> Hi.
> 
> My SQL database assigns a uniqueID to each item. I want to keep this
> uniqueID assosiated to the items that are in Solr even though I wont ever
> need to display them or have them searchable. I do however what to be able
> to target specific items in Solr with it, for updating or deleting the
> record.
> 
> Right now I have this in my schema:
> <field name="id" type="string" indexed="true" stored="true"/>
> 
> However, since I dont want it searchable or stored it should be this:
> <field name="uniqueid" type="string" indexed="false" stored="false"/>
> 
> Firstly, is this the correct way of doing this? I saw mention of a "ignore"
> attibute that can be added.
> 
> Secondly, if I wanted to do updates to the fields using JSON by targetting
> the uniqueID can I still do something like this:
> "delete": { "uniqueid":"7" },                               /* delete entry
> uniqueID=7 */
> 
> Thank you for any help you can give. Hope I explained it well enough.
> 
> James
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/ID-reference-field-Needed-but-not-searchable-or-retrievable-tp4009162.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: ID reference field - Needed but not searchable or retrievable

Posted by Michael Della Bitta <mi...@appinions.com>.
Hi, James,

If you don't store or index this value, it won't exist in Solr.

If you want to be able to find these records by the unique id, you
need to index it. If you want to find the corresponding DB record from
a Solr document you brought up by other means, you'll need to store
the unique id.

Michael Della Bitta

------------------------------------------------
Appinions | 18 East 41st St., Suite 1806 | New York, NY 10017
www.appinions.com
Where Influence Isn’t a Game


On Thu, Sep 20, 2012 at 8:38 AM, Spadez <ja...@hotmail.com> wrote:
> Hi.
>
> My SQL database assigns a uniqueID to each item. I want to keep this
> uniqueID assosiated to the items that are in Solr even though I wont ever
> need to display them or have them searchable. I do however what to be able
> to target specific items in Solr with it, for updating or deleting the
> record.
>
> Right now I have this in my schema:
> <field name="id" type="string" indexed="true" stored="true"/>
>
> However, since I dont want it searchable or stored it should be this:
> <field name="uniqueid" type="string" indexed="false" stored="false"/>
>
> Firstly, is this the correct way of doing this? I saw mention of a "ignore"
> attibute that can be added.
>
> Secondly, if I wanted to do updates to the fields using JSON by targetting
> the uniqueID can I still do something like this:
> "delete": { "uniqueid":"7" },                               /* delete entry
> uniqueID=7 */
>
> Thank you for any help you can give. Hope I explained it well enough.
>
> James
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/ID-reference-field-Needed-but-not-searchable-or-retrievable-tp4009162.html
> Sent from the Solr - User mailing list archive at Nabble.com.