I have these emails : "[email protected]", "[email protected]". I want to sort them
The Solr will return the following result:
I think the correct sort result should be:
The configuration like this:
<field name="email" type="string" indexed="true" stored="true"/>
Anyone could help?
The following is solr response:
{ "responseHeader":{ "status":0, "QTime":0, "params":{ "sort":"advertiser_email_t asc", "indent":"true", "q":":", "wt":"json", "response":{"numFound":3,"start":0,"docs":[ { "advertiser_email_t":"[email protected]", "id":"01df4dea-beb3-46fb-940b-78eda109503c" }, { "advertiser_email_t":"[email protected]", "id":"935de002-10e0-437f-a571-e74bb6646228" }, { "advertiser_email_t":"[email protected]", "id":"2a80935e-e520-4c3e-8d56-8e7b1096b372"}] } }
This is field definition:
<dynamicField name="*_t" type="text_general" indexed="true" stored="true"/>
This is field type definition:
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
After changed field name to "email":
{ "responseHeader": { "status": 0, "QTime": 0, "params": { "sort": "email asc", "indent": "true", "q": ":", "_": "1383822359034", "wt": "json" } }, "response": { "numFound": 2, "start": 0, "docs": [ { "email": "[email protected]", "id": "00000000-0000-0000-0000-000000000002" }, { "email": "[email protected]", "id": "00000000-0000-0000-0000-000000000001" } ] } }
advertiser_email_t
, whose definition you did not share with us. What field type does it have? Could you post more of your schema.xml so that we can see your field types? – cheffe