Search for numbers

In this board you can talk about general questions about phpMyFAQ

Moderators: jason102178, Florian, Thorsten, JochenS

Search for numbers

Postby tschwinn12 » Wed Jan 25, 2012 5:34 pm

Searching for numbers doesn't seem to work or maybe it that is normal?

I have an entry of 29304 and 7.0.29304 in same faq article. Also 29304 in faq topic.

If I do a search for 29304 nothing comes up. If I do a search for 7.0.29304 it works.

is there a way to make it search numbers better?
tschwinn12
 
Posts: 3
Joined: Mon Jan 23, 2012 4:50 pm

Re: Search for numbers

Postby Thorsten » Thu Jan 26, 2012 9:57 am

Hi,

if you search for numbers phpMyFAQ searches for the solution IDs. Every FAQ has an own unique solution ID.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
 
Posts: 12137
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq

Re: Search for numbers

Postby tschwinn12 » Fri Jan 27, 2012 5:46 pm

So no option at all to also search the articles for numbers? any plug-ins available or anything at all to change?

thank you for responding.
tschwinn12
 
Posts: 3
Joined: Mon Jan 23, 2012 4:50 pm

Re: Search for numbers

Postby Thorsten » Fri Jan 27, 2012 6:34 pm

Hi,

not yet, but could be done. Please add your feature request here: https://github.com/thorsten/phpMyFAQ/issues

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
 
Posts: 12137
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq

Re: Search for numbers

Postby legija » Sat Apr 28, 2012 11:27 am

Hi,
Got same problem, please is there any solution to patch this while waiting for an update ?
If I understood it well, numeric searches are redirected to solution id field, can we just disable this, and let it search in content field ?

edit:
Solved with this patch:

Code: Select all
if (is_numeric($inputSearchTerm) && PMF_SOLUTION_ID_START_VALUE <= $inputSearchTerm &&
    1 < $faqSearchResult->getNumberOfResults()) {
   
    // Before a redirection we must force the PHP session update for preventing data loss
    session_write_close();
    if (PMF_Configuration::getInstance()->get('main.enableRewriteRules')) {
        header('Location: '.PMF_Link::getSystemUri('/index.php') . '/content' . $inputSearchTerm . '.html');
    } else {
        header('Location: '.PMF_Link::getSystemUri('/index.php') . '/index.php?content=' . $inputSearchTerm);
    }
    exit();
}


Everything works perfectly now :)
legija
 
Posts: 2
Joined: Thu Apr 26, 2012 3:03 pm

Re: Search for numbers

Postby Sectomy » Mon May 07, 2012 9:29 am

doesnt work for me, any ideas ?
tried it as u written, but nothing changes :(
Sectomy
 
Posts: 6
Joined: Wed Oct 26, 2011 8:13 pm

Re: Search for numbers

Postby legija » Wed May 09, 2012 10:48 am

Sectomy wrote:doesnt work for me, any ideas ?
tried it as u written, but nothing changes :(


It wont work if You use only numeric term in search box. For me it worked, since I use it for error codes description, hence for example, "error code 0x25" gives accurate result, plus numeric term also gets highlighted.
But, if You enter only number, nothing will be returned. This is why I've told it's a patch.

Basically, above posted patch redirects numeric term search into content field in faqdata table, and not the solution_id field.
legija
 
Posts: 2
Joined: Thu Apr 26, 2012 3:03 pm

Re: Search for numbers

Postby jarlaxle2k5 » Mon Sep 24, 2012 9:31 am

legija wrote:Hi,
Got same problem, please is there any solution to patch this while waiting for an update ?
If I understood it well, numeric searches are redirected to solution id field, can we just disable this, and let it search in content field ?

edit:
Solved with this patch:

Code: Select all
if (is_numeric($inputSearchTerm) && PMF_SOLUTION_ID_START_VALUE <= $inputSearchTerm &&
    1 < $faqSearchResult->getNumberOfResults()) {
   
    // Before a redirection we must force the PHP session update for preventing data loss
    session_write_close();
    if (PMF_Configuration::getInstance()->get('main.enableRewriteRules')) {
        header('Location: '.PMF_Link::getSystemUri('/index.php') . '/content' . $inputSearchTerm . '.html');
    } else {
        header('Location: '.PMF_Link::getSystemUri('/index.php') . '/index.php?content=' . $inputSearchTerm);
    }
    exit();
}


Everything works perfectly now :)


Hello guys, i am new on the forum.
I have just a quick question, where should i add this code? In which file ?
Thank you so much for the help.
jarlaxle2k5
 
Posts: 4
Joined: Mon Sep 24, 2012 9:29 am


Return to General discussions

Who is online

Users browsing this forum: No registered users and 0 guests