• Resolved bolus150

    (@bolus150)


    Hi, you can tell me if he’s only going to look after the postmeta field? Ex. key _product_content. If I am looking after the post_content field, I find products like 1080 for example

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter bolus150

    (@bolus150)

    Look this https://ibb.co/2Z2DR3Y. You see? I typed “1080” and found this product for me, but it should not

    Plugin Author Epsiloncool

    (@epsiloncool)

    Okay, @bolus150 , I finally got what you’re trying to say!

    Please read my message till the end before trying anything.

    First, big thank you for this question, because you detected a bug which shown posts even if their relevance was 0. I made an update in WPFTS which fixed this. Thus, if you set up cluster weight for post_content = 0, it will not search in this index cluster at all. Cool.

    Another thing is your ‘product_content’ meta tag. As I understand, you tried to avoid WP from searching for posts by Gutenberg meta tags and comments. For example, if you put an image to the post, this post will be searchable by the word “image” because there is a Gutenberg comment like <– g:image … –> which is recognized by WP integrated search as normal content. Which is completely wrong.

    That’s why I guess you made a new meta tag “product_content”. You are filtering the post_content (by strip_tags or so) in your custom code and save to this meta tag. Let me know if I’m wrong.

    With WPFTS you don’t need for this additional meta tag. Because you can clean up post_content in a stage of indexing. Just use the code:

    add_filter('wpfts_index_post', function($index, $post)
    {
        $index['post_content'] = strip_tags($index['post_content']);
        return $index;
    }, 3, 2);

    You can use your own custom function instead of strip_tags().

    Realizing that many WP users who decided to use Gutenberg (almost all I guess) may face the same problem, I added this piece of code and a respective option to the settings.

    This is how it looks: https://e-wm.org/i/E20190802-074346-001.png

    And now you don’t need to add any code at all. And you also may remove the product_content meta.

    Please update the WPFTS plugin now and let me know if it helps somehow.

    Thanks!

    • This reply was modified 5 years, 3 months ago by Epsiloncool.
    Thread Starter bolus150

    (@bolus150)

    Well. Thank you very much for your help. The main search engine works without any problems, the treatment in “Sandbox Area” still has this record when you enter “1080”. My configuration:

    https://ibb.co/Fzyypv8
    https://ibb.co/R90tL1d
    https://ibb.co/7jzcQn8
    https://ibb.co/jVJMJ5R

    Plugin Author Epsiloncool

    (@epsiloncool)

    You disabled WPFTS in the Sandbox Area
    https://e-wm.org/i/E20190802-130721-001.png

    could you try to switch this checkbox off?

    Thread Starter bolus150

    (@bolus150)

    Thank you very much for your help. Everything works as it should. I love it! Have a nice day!

    Plugin Author Epsiloncool

    (@epsiloncool)

    And thank you a lot, both we removed one bug and added the new feature to the plugin ??

    Thread Starter bolus150

    (@bolus150)

    Hey! Your plugin causes an infinite database query loop. I had to turn it off.

    Plugin Author Epsiloncool

    (@epsiloncool)

    @bolus150 Which database table engine you have used? If it’s MyISAM, try to switch to InnoDB.

    Thread Starter bolus150

    (@bolus150)

    Use InnoDB

    Plugin Author Epsiloncool

    (@epsiloncool)

    Ok, which WPFTS version you are using?

    Thread Starter bolus150

    (@bolus150)

    1.16.29

    Thread Starter bolus150

    (@bolus150)

    Do you help me?

    Plugin Author Epsiloncool

    (@epsiloncool)

    @bolus150 I need a bit more information about this issue. Actually, I’ve not heard about MySQL stucking since version 1.5 when we have completely redone MySQL queries. Also, I didn’t get such bug reports from other users for the last 2 years, so it feels like a specific combination of software/hardware versions.

    Do you know MySQL Server version and the exact query which stucks?

    Thread Starter bolus150

    (@bolus150)

    5.7.21-20

    Plugin Author Epsiloncool

    (@epsiloncool)

    @bolus150 I have made a quick googling about MySQL hang issue and yes, lots of cases when MySQL can hang… Sometimes it’s a bug in exact MySQL version, sometimes the reason for this is too small cache size. I should say, WPFTS actively using MySQL internal indexes and caching to achieve faster search, so maybe it’s the reason why you don’t see hangs without WPFTS running.

    Again, nobody sent us this bugreport for at least 2 years, so I can’t say this issue is usual.

    I would like to recommend you to solve this with your hoster, or, in case you have root access to MySQL, try to repeat this situation and when MySQL hang again, check the processlist and send me screenshot of the problem.

    “SHOW ENGINE INNODB STATUS” result will also help.

    Thanks!

Viewing 15 replies - 16 through 30 (of 36 total)
  • The topic ‘Search only postmeta’ is closed to new replies.