Elaine, The field type text contains <tokenizer class="solr.WhitespaceTokenizerFactory"/> in its definition. So all the sentences that are indexed / queried will be split in to words. So when you search for 'get what you', you will get sentences containing get, what, you, get what, get you, what you, get what you. So when you try to find the indexOf of the keyword in that sentence (from results), you may not get it all the times.
Solrj can give the results in one shot but it uses http call. You cant avoid it. You don't need to query multiple times with Solrj. Query once, get the results, store them in java beans, process it and display the results. Regards, Sandeep Elaine Li wrote: > > Sandeep, I do get results when I search for "get what you", not 0 results. > What in my schema makes this difference? > I need to learn Solrj. I am currently using javascript as a client and > invoke http calls to get results to display in the browser. Can Solrj > get all the results at one short w/o the http call? I need to do some > postprocessing against all the results and then display the processed > data. Submitting multiple http queries and post-process after each > query does not seem to be the right way. > -- View this message in context: http://www.nabble.com/How-to-retrieve-the-index-of-a-string-within-a-field--tp25771821p25798586.html Sent from the Solr - User mailing list archive at Nabble.com.