A further update on this is that (when 'Date' is searched using the same URL
as posted in the previous message), whether Date is of type string or text,
the full (exact) content of a field has to be searched to return a result. 

Why is this not the case with Content? I tried changing the default search
field to 'Date' to see if that made a difference and nothing changed.



Johnny X wrote:
> 
> Do you know the specific syntax when querying different fields?
> 
> http://localhost:8080/solr/select/?q=Date:%222000%22&version=2.2&start=0&rows=10&indent=on
> 
> doesn't appear to return anything when I post it in my browser, when it
> should, but (as before) if you change 'Date' to 'Content' it works!
> (presumably because content is the default field). Is there nothing else I
> have to change to make sure they're returned? All fields are indexed and
> stored, but 'Content' is the only 'text' field, the others are 'string'.
> 
> Going back to dismax, it looks like that's more useful for boosting than
> specifying multiple fields because it works a lot like copyfields (in that
> it compounds all of the fields together in one big search). If I were to
> do that, there'd be no need to have anything more than one user input box
> because it won't be separated by field anyway.
> 
> 
> 
> Erik Hatcher wrote:
>> 
>> 
>> On Apr 13, 2009, at 11:20 AM, Johnny X wrote:
>> 
>>>
>>> Also, in reference to the other question, I'm currently trying to  
>>> edit the
>>> main search page to search multiple fields.
>>>
>>> Essentially, I detect if each field has been posted or not using:
>>>
>>> if ($_POST['FIELD'] != '') {
>>> $query = $query . '+FIELDNAME:' . $_POST['FIELD'];
>>> }
>>>
>>> Once it's processed all the fields, its then sent to query solr, but  
>>> I'm not
>>> sure if I'm getting the syntax right or if there's anything in the  
>>> Solr
>>> config file I need to modify (dismax?) because it still only returns  
>>> results
>>> when I enter a search in the 'content' field (also the default Solr  
>>> field).
>>>
>>> My Solr query looks like:
>>>
>>>    $query = "?q=".trim(urlencode($query)).
>>>        '&version=2.2&start=0&rows=999999&indent=on';
>>>
>>> where $query will look something like "Content: 35 million+Date:  
>>> 16th Oct"
>>> etc, until it has been urlencoded/trimmed.
>>>
>>> Will it still only return results on 'content' searches because  
>>> that's the
>>> only default field?
>> 
>> You'll need to read up on Lucene/Solr query parser syntax to be able  
>> to build useful queries programatically like that:
>> <http://wiki.apache.org/solr/SolrQuerySyntax 
>>  >  Your syntax above is not doing what you might think... you'll want  
>> to surround expressions with quotes or in parens for a single field.   
>> Content:(35 million) for example.
>> 
>> It'll be best if you decouple your questions about query parsing from  
>> PHP code though.  And don't forget that &debugQuery=true is your  
>> friend, so you can see how queries are being parsed.  Providing that  
>> output would be helpful to see what is actually happening with what  
>> you're sending.
>> 
>>      Erik
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PHP-Remove-From-Index-Search-By-Fields-tp22996701p23025514.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to