OK, as of 9.7, you need to explicitly add an analyzer to the json managed
schema call for the field:
...
      "uninvertible": true,
      "analyzer": {
        "type": "index",
        "tokenizer": {
          "class": "solr.StandardTokenizerFactory"
        },
        "filters": [
          {
            "class": "solr.LowerCaseFilterFactory"
          }
        ]
      }
    }
...

Here's my revised curl command:
curl -X POST -H 'Content-type:application/json' \
  "http://localhost:8983/solr/$COLLECTION/schema"; \
  -d '{
    "add-field-type": {
      "name": "faceted_texts",
      "class": "solr.TextField",
      "stored": true,
      "indexed": true,
      "docValues": true,
      "uninvertible": true,
      "analyzer": {
        "type": "index",
        "tokenizer": {
          "class": "solr.StandardTokenizerFactory"
        },
        "filters": [
          {
            "class": "solr.LowerCaseFilterFactory"
          }
        ]
      }
    }
  }'



On Thu, Oct 30, 2025 at 8:31 PM Mark Bennett <[email protected]> wrote:

> So I read about uninvert.  Still a little fuzzy, can I not have a faceted
> field that is tokenized?  uninvertible=true brought back faceting, but
> treated my entire doc as one long string / one long facet value, that's not
> what I wanted?
>
> On Thu, Oct 30, 2025 at 8:29 PM Mark Bennett <[email protected]> wrote:
>
>> To me, it seems odd to make a breaking change like that in the middle of
>> a major release, maybe would have expected something like that in 10x.
>>
>> On Thu, Oct 30, 2025 at 8:21 PM Mark Bennett <[email protected]>
>> wrote:
>>
>>> Thanks Andy.
>>>
>>> Adding that to my text field does change the behavior, I get one giant
>>> facet value (untokenized) and can't searched by keyword (likely the same
>>> issue).  Clearly I need to go read about uninvertable fields.
>>>
>>> Thanks for getting me unstuck,
>>> Mark
>>>
>>> On Thu, Oct 30, 2025 at 1:52 PM Andy Webb <[email protected]> wrote:
>>>
>>>> hi Mark,
>>>>
>>>> I think you'll need to set uninvertible=true in the schema to re-enable
>>>> faceting on a text_general field - the default changed from true to
>>>> false
>>>> in 9.7:
>>>>
>>>> https://solr.apache.org/guide/solr/9_7/indexing-guide/field-type-definitions-and-properties.html
>>>>
>>>> Hope this helps!
>>>> Andy
>>>>
>>>> On Thu, 30 Oct 2025 at 19:14, Mark Bennett <[email protected]>
>>>> wrote:
>>>>
>>>> > Below is the test script that I used.  I'm on MacOS
>>>> >
>>>> > I realize faceting on tokenized text fields is a bit atypical, but I
>>>> use it
>>>> > as a dev tool to check the index.
>>>> >
>>>> > Here's the pertinent diff:
>>>> > 115c117
>>>> > <
>>>> >
>>>> >
>>>> "test_t":["a",1,"indexing",1,"is",1,"of",1,"solr",1,"system",1,"terms",1,"test",1,"the",1,"this",1]
>>>> > ---
>>>> > >       "test_t":[ ]
>>>> >
>>>> >
>>>> > Here's my test script:
>>>> >
>>>> > #!/bin/bash
>>>> >
>>>> > COLLECTION=test
>>>> > NUM_SHARDS=1  # Solr v9 (maybe earlier) doesn't restrict to single
>>>> shard,
>>>> > BUT doesn't matter for our small dataset
>>>> > TERMS=test
>>>> > TYPE=text_general
>>>> > SUFFIX=_t
>>>> > FIELD=test$SUFFIX
>>>> > DOC_ID=doc1
>>>> >
>>>> > echo;echo
>>>> > echo Removing Any Previous collection - will give error if run for the
>>>> > first time
>>>> > curl "
>>>> >
>>>> http://localhost:8983/solr/admin/collections?action=DELETE&name=$COLLECTION
>>>> > "
>>>> >
>>>> > echo;echo
>>>> > echo Creating Collection $COLLECTION with $NUM_SHARDS shards
>>>> > curl "
>>>> >
>>>> >
>>>> http://localhost:8983/solr/admin/collections?action=CREATE&name=$COLLECTION&numShards=$NUM_SHARDS&replicationFactor=1&maxShardsPerNode=$NUM_SHARDS
>>>> > "
>>>> >
>>>> > echo;echo
>>>> > echo Adding doc id = $DOC_ID with TERMS = $TERMS
>>>> > curl -X POST "
>>>> http://localhost:8983/solr/$COLLECTION/update?commit=true"; \
>>>> >      -H "Content-Type: application/json" \
>>>> >      -d "[
>>>> >        {
>>>> >          \"id\": \"$DOC_ID\",
>>>> >          \"$FIELD\": \"this is a test of the Solr indexing system:
>>>> TERMS =
>>>> > $TERMS\"
>>>> >        }
>>>> >      ]"
>>>> >
>>>> > echo;echo
>>>> > echo Query for all docs
>>>> > curl "http://localhost:8983/solr/$COLLECTION/select?q=*:*";
>>>> >
>>>> > echo;echo
>>>> > echo Query for TERMS = $TERMS
>>>> > curl "
>>>> >
>>>> >
>>>> http://localhost:8983/solr/$COLLECTION/select?defType=edismax&qf=$FIELD&q=$TERMS&rows=1
>>>> > "
>>>> >
>>>> > echo;echo
>>>> > echo Testing Facet API
>>>> > curl "
>>>> >
>>>> >
>>>> http://localhost:8983/solr/$COLLECTION/select?q=*:*&rows=0&facet=true&facet.field=$FIELD
>>>> > "
>>>> >
>>>> > echo;echo
>>>> > echo Done
>>>> >
>>>>
>>>
>>>
>>> --
>>> Mark Bennett / [email protected] / Cell: 408-829-6513
>>>
>>
>>
>> --
>> Mark Bennett / [email protected] / Cell: 408-829-6513
>>
>
>
> --
> Mark Bennett / [email protected] / Cell: 408-829-6513
>


-- 
Mark Bennett / [email protected] / Cell: 408-829-6513

Reply via email to