Search functionality

A place for users and developers of the Xataface to discuss and receive support.

Search functionality

Postby kevinwen » Fri Jul 09, 2010 6:09 pm

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?
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm

Re: Search functionality

Postby chichi » Sat Jul 10, 2010 2:06 am

I did see a select-box-function for choosing the database you want to seach in. A global search function would be nice.

chichi
chichi
 
Posts: 28
Joined: Fri Jul 09, 2010 3:05 am

Re: Search functionality

Postby shannah » Tue Jul 13, 2010 10:26 am

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Search functionality

Postby kevinwen » Tue Jul 13, 2010 2:26 pm

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?
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm

Re: Search functionality

Postby shannah » Tue Jul 13, 2010 2:41 pm

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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Search functionality

Postby omills » Tue Jun 14, 2011 11:04 am

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?
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am

Re: Search functionality

Postby shannah » Tue Jun 14, 2011 11:15 am

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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Search functionality

Postby the_woz » Fri Sep 16, 2011 12:00 pm

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.
the_woz
 
Posts: 12
Joined: Fri Sep 16, 2011 11:37 am

Re: Search functionality

Postby shannah » Fri Sep 16, 2011 12:18 pm

Thanks for pointing this out. I have included this fix in SVN to be included in the next release.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 23 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved