Jump to content

Searching fot term in repeater.


activestate
 Share

Recommended Posts

Hi,
I'm having problems with seatching for a value in repeater.
One of pages have attached repeater called 'insight_repeater'.
This repeater has h1_tag (text field) and i'm trying to search for repeater items that contains 'lor' phrase.

And right now i'm trying to do simple search, looking for phrase 'lor'. I've tried many approaches, but nothins seems to work, so i want to ask what i'm doing wrong here:

<?php $query = $page->get("insight_repeater")->find('h1_tag~=Lor'); ?>

Thanks for help.
 

Link to comment
Share on other sites

I've just checked this.
first case returns:
noticee: trying to get property on non object in...

and the second returns nothing ...
I'm using latests dev version.

Cheers.

Recently, i see that my code is actually working, but if h1_tag contains "Lorem" i'm only able to make this work if i'll type:

<?php $query = $page->get("insight_repeater")->find('h1_tag~=Lorem'); ?> and not Lor. Is there any workaround ?

Link to comment
Share on other sites

3 hours ago, activestate said:

<?php $query = $page->get("insight_repeater")->find('h1_tag~=Lorem'); ?> and not Lor. Is there any workaround ?

Welcome to the forums @activestate

Have a read here about selectors, specifically about MySQL and short words.

Quote

The *= and ~= rely upon MySQL fulltext indexes, which only index words of at least a certain length (configurable, but typically 4 characters). They also don't index common English words called stopwords. So while it's preferable to use *= and ~= for their speed, if you aren't getting the results you need, you should consider using %= instead (if you can handle the speed hit).

 

Please use code blocks (@see the <> icon) around your code.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...