App Search UI Display Character Limit

Hello,

I want to ask, is there a character limit to display in the App Search UI?

I have problem where I have a long character value of data and I realized the UI does not display all of the character.

When I configure the Result Settings, the limit is no limit already.

Let say for example I use the national park data, the description field have a long character and should display until 'elevations' :

However, the UI only display until 'Appalachian' :

It does not display everything as the character is too long, how should I fix this?

Thank you.

hi there @aisyaharifin

Are you using snippet or raw for the display? AFAIK, raw should return the full value of the field rather than snippet which is by default limited to 100 characters.

Its likely you're using snippet for something like description.

See docs for more information. Search API result fields | App Search documentation [8.8] | Elastic

Thanks
Joe

Hi @joemcelroy ,

Thank you for your reply.

Apparently, all the display already set in raw for all the fields, its by default ones and never changed.

But it still not displaying all the characters, it is crucial for me to display it to achieve the searching purpose.

It might be the css style issue, can I know which part I need to adjust the script in order for it to show full display of the characters value of data?

Not sure if its under config-helper.js , but it seems like the raw one it not delimited :

const resultFields = (config.resultFields || config.fields || []).reduce(
    (acc, n) => {
      acc = acc || {};
      acc[n] = {
        raw: {},
        snippet: {
          size: 100,
          fallback: true
        }
      };
      return acc;

Thank you for your assistance.

Hi there,

Raw is the original value of the field and will not contain highlighting attributes. Snippet will contain highlighting (matches will be contained in an html em tag). using snippet means that when a match is found, it will only display upto 100 characters of where the match was present.

If you're using Search UI (as you mentioned config-helper, it sounds like you are), it will use the snippet. Whats happening is the config-helper is requesting for snippets instead, overriding the defaults set in the UI.

You have two options:

  • I dont want highlighting: update config-helper to remove the snippet object. I believe it should work if the code was this
const resultFields = (config.resultFields || config.fields || []).reduce(
  (acc, n) => {
    acc = acc || {};
    acc[n] = {
      raw: {}
   }; 
   return acc;
})
  • update config-helper and Increase snippet size to a higher number

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.