used additional field as facet field

(from github.com/mokkouyou)
I added additional field ,using datastore crawler, and used as facet field but get errors.
Do I need something else for using facet?

#version
11.3

#api query
http://localhost:8088/json/?q=*&facet.field=addeddfield

#error
IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [addeddfield] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.];

#fess_config.properties
query.additional.response.fields=addeddfield
query.additional.api.response.fields=addeddfield
query.additional.cache.response.fields=addeddfield
query.additional.highlighted.fields=
query.additional.search.fields=addeddfield
query.additional.facet.fields=addeddfield

#created mapping
addeddfield: {
type: “text”,
fields: {
keyword: {
type: “keyword”,
ignore_above: 256
}
}
},

I think that type should be keyword, but what should I do?

(from github.com/mokkouyou)
sorry

In this way I did what I wanted to do

//mod
query.additional.facet.fields=addeddfield.keyword

//mod query
http://localhost:8088/json/?q=*&facet.field=addeddfield.keyword

(from github.com/mokkouyou)
should I close this?

(from github.com/mokkouyou)
use facet result in search query
//mod
query.additional.search.fields=addeddfield.keyword

(from github.com/marevol)
To add own field, you need to add a proper elasticsearch mapping before crawling.
Elasticsearch requires fielddata=true for aggregation.

(from github.com/mokkouyou)
OK, I see

thanks

How to show additional facets in the search results of the search GUI. I can see the additional facets in JSON results using &facet.field=xxx. I have tried to add in [“xxx”] as stated in Custom facets. But I still can’t see the additional facets in the search results. Am I missing some settings.

An example setting is in codesearch.codelibs.org.
In the latest version, you can set the settings in fess_config.properties.
organization,repository and filename are additional facet fields.

I can see my new facet data in the JSON results, but not in the web GUI. What is the difference between “/json” and “/search”?

What did you modify?

Even in a clean install, I can’t see new facets in the Web interface (/search). But I can see them in JSON API (/json). Moreover, If I enable JSON Response, all the data shown without authentication. Web interface (/search) is asking to login.

all the data shown without authentication.

You need to set a permission(role) to indexed documents.

Web interface (/search) is asking to login.

This feature is not for a secure search.