Won’t work. String types are totally unanalyzed. Your string_ci fieldType is 
what I was looking for.

No, you shouldn’t kill the lowercasefilter unless you want all of your searches 
will then be case-sensitive.

So you should try:

q=edgy_text:whatever&sort=string_ci asc

Please use the admin>>pick_core>>analysis page when thinking about changing 
your schema, it’ll answer a _lot_ of these questions immediately.

Best,
Erick

> On Mar 24, 2020, at 8:37 AM, matthew sporleder <msporle...@gmail.com> wrote:
> 
> Oh maybe a schema bug!
> 
> my string_ci:
> <fieldType name="string_ci" class="solr.TextField"
> sortMissingLast="true" omitNorms="true">
>     <analyzer>
>          <tokenizer class="solr.KeywordTokenizerFactory"/>
>          <filter class="solr.LowerCaseFilterFactory" />
>     </analyzer>
>  </fieldType>
> 
> going to try this instead:
>  <fieldType name="string_lctoken" class="solr.StrField"
> sortMissingLast="true" omitNorms="true">
>     <analyzer>
>          <tokenizer class="solr.KeywordTokenizerFactory"/>
>          <filter class="solr.LowerCaseFilterFactory" />
>     </analyzer>
>  </fieldType>
> 
> Then I can probably kill the lowercasefilter on edgeytext:
> 
> 
> 
> On Tue, Mar 24, 2020 at 7:44 AM Erick Erickson <erickerick...@gmail.com> 
> wrote:
>> 
>> Sort by the full field. You’ll need to copy to a field with keywordTokenizer 
>> and lowercaseFilter (string_ci? assuming it’s not really a :”string”) type.
>> 
>> Best,
>> Erick
>> 
>>> On Mar 24, 2020, at 7:10 AM, matthew sporleder <msporle...@gmail.com> wrote:
>>> 
>>> I have added an edge ngram field to my index and get decent results
>>> with partial words but the results appear randomly sorted and all
>>> contain the same score.  Ideally I would like to sort by shortest
>>> ngram match within my other qualifiers.
>>> 
>>> Is there a canonical solution to this?
>>> 
>>> Thanks,
>>> Matt
>>> 
>>> p.s. I mostly followed
>>> https://lucidworks.com/post/auto-suggest-from-popular-queries-using-edgengrams/
>>> 
>>> schema bits:
>>> 
>>> <fieldType name="edgytext" class="solr.TextField" 
>>> positionIncrementGap="100">
>>> <analyzer type="index">
>>>  <tokenizer class="solr.KeywordTokenizerFactory"/>
>>>  <filter class="solr.LowerCaseFilterFactory"/>
>>>  <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
>>> maxGramSize="25" />
>>> </analyzer>
>>> 
>>> <field name="slug" type="string_ci" indexed="true" stored="true"
>>> multiValued="false" />
>>> 
>>> <field name="fayt" type="edgytext" indexed="true" stored="false"
>>> omitNorms="false" omitTermFreqAndPositions="true" multiValued="true"
>>> />
>>> 
>>> 
>>> <copyField source="slug" dest="fayt" maxChars="65" />
>> 

Reply via email to