Page 1 of 1

Search functionality

PostPosted: Fri Jul 09, 2010 6:09 pm
by kevinwen
Hi, Steve

In the search box on the upper right corner, I not only want to search something in the current table, but also something in the related table. Is that possible? How?

Re: Search functionality

PostPosted: Sat Jul 10, 2010 2:06 am
by chichi
I did see a select-box-function for choosing the database you want to seach in. A global search function would be nice.

chichi

Re: Search functionality

PostPosted: Tue Jul 13, 2010 10:26 am
by shannah
Xataface's full-text search feature allows you to introduce a multi-table search. You need to specify which tables you want to index in the conf.ini file. Then you can start things off by manually building the index in the Control Panel (link in top right of application if you have full permissions).

Here is a segment of the conf.ini file for xataface.com which specifies that the multi-table search searches a few tables:
Code: Select all
[_index]
   howtos=1
   phpbb_posts=1
   tutorials=1
   tutorial_pages=1

Re: Search functionality

PostPosted: Tue Jul 13, 2010 2:26 pm
by kevinwen
I have 2 issues here:
1. When I did what you said, I got "No matches for the query provided, please try again." message and also a PHP notice below that might cause the no matches:

Notice: Undefined index: -table in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xataface-1.2.4\Dataface\Index.php on line 278


2. What I want to search for is the search for all matching records in the parent table and those records in its child (relationship) table that match the keyword in the search box, Not all of the matching records across the site. The /Dataface/actions/find.php takes care of it. Is there any way we can search only for the specific table and its relationship tables?

Re: Search functionality

PostPosted: Tue Jul 13, 2010 2:41 pm
by shannah
You can build a URL that will give you this type of result set. See http://xataface.com/wiki/URL_Conventions
And if you can build a URL, you can create an HTML form that will produce that URL.

Re: Search functionality

PostPosted: Tue Jun 14, 2011 11:04 am
by omills
I am finding that I need to run the re-index manually (from the control panel) for items to show up in the global search.
How frequently does the index run? Do/should I setup a cron job?

Re: Search functionality

PostPosted: Tue Jun 14, 2011 11:15 am
by shannah
Any updates made through Xataface will automatically be added to the global index. If you make updates outside of Xataface, then the frequency of index regeneration is up to you.

Re: Search functionality

PostPosted: Fri Sep 16, 2011 12:00 pm
by the_woz
Hi, I was having the same problem as omills. (xataface-1.3rc6)

I searched through the code and found that line 699 at Dataface/IO.php never resolved as true:

Code: Select all
      if ( isset($app->_conf['_index'])  and @$app->_conf['_index'][$record->table()->_tablename]){


I removed the underscore in front of '_tablename' call and now the indexing works as intended:

Code: Select all
      if ( isset($app->_conf['_index'])  and @$app->_conf['_index'][$record->table()->tablename]){


I noticed that '_tablename' is a variable in the record class and using

Code: Select all
      if ( isset($app->_conf['_index'])  and @$app->_conf['_index'][$record->_tablename]){


also worked fine.

I just started building a site with Xataface and I'm having a blast! :) It's exactly what I was looking for.

Keep the good work.

Re: Search functionality

PostPosted: Fri Sep 16, 2011 12:18 pm
by shannah
Thanks for pointing this out. I have included this fix in SVN to be included in the next release.