Indexing profiles

With a couple of applications that create new profiles using $LW->dbo functions (old applications) we’ve seen issues with newly created profiles not being findable until they are viewed or listed in the backend. In one application’s code, I see this function: $_LW->d_search->indexItem() which makes me wonder if the issue is caused by an indexing operation that isn’t being run.

Without updating the application, I’d like to find a way to touch each of the profiles - I think this might solve the immediate problem of their not being findable. Is there a way to do this, in the backend or otherwise? Like a re-index function that could be run on a type of profile? Or am I on the wrong track with this indexing idea?

Thanks,
Ed

Hi Ed,

Good call – yes, $_LW->dbo is definitely not the recommended way to create profiles (or any LiveWhale data type) in 2025. $_LW->create() is the endpoint to use for that kind of action in any newly-created code. That does all the work of creating/indexing any linked fields for you.

For your legacy code, then sure, you could try adding to your loop something like this

$_LW->d_search->indexItem('profiles', $profile_id]);

for each edited profile, that would tell the LiveWhale search module to re-index that profile.

1 Like