On 9/12/2017 7:21 AM, Nick Way wrote:
> Thank you very much Erik, Walter and Susheel.
>
> To be honest I didn't really understand the suggested routes (due to my
> limited knowledge) but managed to get things working by inserting my data
> with a double comma at the beginning eg:
>
> custom field "listOfIDs" = ",,1,2,4,33"
>
> and then searching for "*,myVal,*" which seems to work.

If you're going to index it as a single string and leave it that way,
that will be your only real option.  A wildcard search is generally
slower than other options.

Instead, you should break that list apart in your indexing software, and
index multiple values for that field instead of a single value
containing commas.  Then you can search for single values easily and
quickly.  To do this, the field must be marked as multiValued in your
schema.

Alternatively, you could use a TextField type in your schema and include
a tokenizer or filter that will split on the commas.  If the field is
stored, the search results would contain the original comma separated
string, not the separate values.  Also, if the list will always be
numbers, you would not be able to do a numeric range query, because the
values would be strings, not numbers.

> Out of interest does anyone have experience accessing Solr via Adobe
> Coldfusion (as this is what we do) - and it would be helpful to have a
> contact for some Solr consulting from time to time, if anyone might be
> interested in that?

I have never done any work in ColdFusion.

There are some CF Solr libraries.  This page also says that version 9
includes it natively:

https://wiki.apache.org/solr/IntegratingSolr

Thanks,
Shawn

Reply via email to