Hi,
You could accomplish this by adding several FileNumber fields. I'm
guessing that a regexp would suffice to extract the number from the
complete value.
var document = new Document();
document.Add(new Field("FileNumber", "ABC-12345", Field.Store.NO,
Field.Index.NOT_ANALYZED));
document.Add(new Field("FileNumber", "12345", Field.Store.NO,
Field.Index.NOT_ANALYZED));
// Simon
On 2012-01-18 17:36, Brian Sayatovic wrote:
I have some data (files) that have prominent identifiers (file
numbers) that users often know the files by. File numbers are in the
form of "[group]-[number_within_region]". For example, "ABC-12345"
and "XYZ-12345". Today, I add a non-analyzed Field named "FileNumber"
with that full value.
However, while some users often work across many group, most users
search within a particular group. Therefore most users are bothered
by having to enter their group prefix when searching. XYZ users would
prefer to enter just "12345" instead of "XYZ-12345".
How can I make it so users can search by just the suffix (e.g.
"12345", to find both "ABC-12345" and "XYZ-12345"), or the full file
number? It seems the StandardAnalyzer doesn't break terms on hyphens.
Regards,
Brian.
*Brian Sayatovic*
Senior Software Architect
866 218 1003 toll-free ext. 8936
937-235-8936 office
4540 Honeywell Ct. Dayton, OH 45424
The CINgroup
Facebook
<http://www.facebook.com/pages/The-CINgroup/161740787235897><http://https://twitter.com/theCINgroup>
This message may contain confidential/proprietary information from the
CINgroup or its subsidiaries.
If you are not an intended recipient, please refrain from the
disclosure, copying, distribution or use of this information. All such
unauthorized actions are strictly prohibited. If you have received
this transmission in error, please notify the sender by e-mail and
delete all copies of this material from any computer.