Am 20.07.2011 18:03, schrieb Kyle Lee:
Perhaps I'm missing something, but if your fields are indexed as "1234567"
but users are searching for "AB1234567," is it not possible simply to strip
the prefix from the user's input before sending the request?
On Wed, Jul 20, 2011 at 10:57 AM, Per Newgro<per.new...@gmx.ch> wrote:
Hi,
i'm new to solr. I built an application using the standard solr 3.3
examples as default.
My id field is a string and is copied to a solr.TextField ("searchtext")
for search queries.
All works fine except i try to get documents by a special id.
Let me explain the detail's. Assume id = "1234567". I would like to query
this document
by using q=searchtext:AB1234567. The prefix ("AB") is acting as a pseudo-id
in our
system. Users know and search for it. But it's not findable because
solr-index only knows
the "short id".
Adding a new document with the prefixed-id as id is not an option. Then i
have to add
many documents.
For my understanding stemming and ngram tokenizing is not possible
because they act on tokens longer then the search token.
How can i do this?
Thanks
Per
Sorry for being not clear here. I only use a single search field. It can
contain multiple search words.
One of them is the id. So i don't realy know that the search word is an id.
The usecase is: We have a product database with some items. The product
has an id, name, features
etc. They all go in the described serachtext field. We promote our
products in different medias. So every
product can have a mediaid (AB is mediacode 1234567 is the id). And
users should be able to find
the product by id and mediaid.
I hope i could explain myself better.
Thanks for helping me
Per