On Apr 10, 2009, at 8:36 PM, Johnny X wrote:
How could I write some code in PHP to place in a button to remove a returned
item from the index?

You can issue a delete command to Solr by simply doing a GET (or POST) to http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cid%3ESOMEID%3C/id%3E%3C/delete%3Eete%3E%3Cquery%3Esome:query%3C/query%3E%3C/delete%3E&commit=true

(replace SOMEID with whatever unique id you want, or switch to use the delete-by-query)

In turn, is it possible to copy all of the XML elements from said item and
place them in a document somewhere locally once it's been removed?

You could do a /select?q=id:SOMEID&fl=* and get all stored field values (note you'll lose any unstored values) and stash those results off however you like.

Finally, there is one default search field. How do you search on multiple
different fields in PHP?

Use the dismax parser. /select? q=whatever&defType=dismax&qf=field1+field2

See the wiki docs on dismax for more details and list of other parameters.

If I wanted to search by all of the fields indexed, is that easy to code?

You could list all fields in the qf field of dismax.

Another option is to copyField all fields you want searchable into a single field and search that single field.

What changes do I need to make in the XML schema?

To use dismax, no changes to schema are needed (necessarily).

But you may want to add copyField's to schema.xml to collect all field text into a single field for default field searchability.

        Erik

Reply via email to