Developer forum

Forum » Development » Find string in content from api

Find string in content from api

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I need to search all content from within the api, for a specific text-string. By content, I mean both pages, paragraphs and items.

There is a lot of different item-types, so I would rather not iterate through each and every item-type, if it's not nessary.

What is the best way of doing this? Are there any xml of the content from the different types of content?

--
Best regards
Kurt Moskjaer Andersen


Replies

 
Nicolai Pedersen
Reply

The best way would to be to content index builder.

Altneratively loop all pages, all paragraphs and all fields on all items on all pages and paragraphs - but it would be slow and load lots from database, so I would be careful.

Can you describe the use case?

NP

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Nicolai,

My customer would like a report, with all images in the root of the Files-section, with a reference to where they are used on the site, if any.

The customer has a lot of items, so it would give a huge load on the website, if we should loop through all content, for each image file.

/Kurt

 
Nicolai Pedersen
Reply

It is a difficult one - a lot of the file fields have just the name of the file, i.e. "Image.jpg" - but it is impossible to guess in what folder....

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

They just want to check all image-files in the root of the Images-folder, but still there is a lot of items and content to iterate through

 

You must be logged in to post in the forum