Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search API Fix #654

Merged
merged 5 commits into from Jul 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 7 additions & 9 deletions sources/admin/ManageSearch.php
Expand Up @@ -203,7 +203,7 @@ function _initSearchSettingsForm()
'',
// Some limitations.
array('int', 'search_floodcontrol_time', 'subtext' => $txt['search_floodcontrol_time_desc'], 6, 'postinput' => $txt['seconds']),
array('title', 'additiona_search_engines'),
array('title', 'additional_search_engines'),
array('callback', 'external_search_engines'),
);

Expand Down Expand Up @@ -234,7 +234,7 @@ function settings()
'',
// Some limitations.
array('int', 'search_floodcontrol_time', 'subtext' => $txt['search_floodcontrol_time_desc'], 6, 'postinput' => $txt['seconds']),
array('title', 'additiona_search_engines'),
array('title', 'additional_search_engines'),
array('callback', 'external_search_engines'),
);

Expand Down Expand Up @@ -304,8 +304,6 @@ function action_edit()
{
global $txt, $context, $modSettings, $db_type, $db_prefix;

$db = database();

// need to work with some db search stuffs
$db_search = db_search();
$db = database();
Expand Down Expand Up @@ -433,6 +431,7 @@ function action_edit()
'table_name' => str_replace('_', '\_', $db_prefix) . 'messages',
)
);

if ($request !== false && $db->num_rows($request) == 1)
{
// Only do this if the user has permission to execute this query.
Expand Down Expand Up @@ -462,6 +461,7 @@ function action_edit()
'table_name' => str_replace('_', '\_', $db_prefix) . 'log_search_words',
)
);

if ($request !== false && $db->num_rows($request) == 1)
{
// Only do this if the user has permission to execute this query.
Expand Down Expand Up @@ -560,8 +560,6 @@ function action_create()
{
global $modSettings, $context, $db_prefix, $txt;

$db = database();

// Get hang of db_search
$db_search = db_search();
$db = database();
Expand Down Expand Up @@ -618,9 +616,7 @@ function action_create()

// Step 0: let the user determine how they like their index.
if ($context['step'] === 0)
{
$context['sub_template'] = 'create_index';
}

// Step 1: insert all the words.
if ($context['step'] === 1)
Expand Down Expand Up @@ -720,6 +716,7 @@ function action_create()
$inserts,
array('id_word', 'id_msg')
);

if ($num_messages['todo'] === 0)
{
$context['step'] = 2;
Expand All @@ -734,7 +731,6 @@ function action_create()
$context['percentage'] = round($num_messages['done'] / ($num_messages['done'] + $num_messages['todo']), 3) * 80;
}
}

// Step 2: removing the words that occur too often and are of no use.
elseif ($context['step'] === 2)
{
Expand Down Expand Up @@ -783,6 +779,7 @@ function action_create()
break;
}
}

$context['percentage'] = 80 + round($context['start'] / $index_properties[$context['index_settings']['bytes_per_word']]['max_size'], 3) * 20;
}
}
Expand Down Expand Up @@ -1009,6 +1006,7 @@ function detectFulltextIndex()
while ($row = $db->fetch_assoc($request))
if ((isset($row['Type']) && strtolower($row['Type']) != 'myisam') || (isset($row['Engine']) && strtolower($row['Engine']) != 'myisam'))
$context['cannot_create_fulltext'] = true;

$db->free_result($request);
}
}
Expand Down
2 changes: 1 addition & 1 deletion sources/subs/SearchAPI-Custom.class.php
Expand Up @@ -19,7 +19,7 @@
die('No access...');

/**
* SearchAPI-Custom.php, Custom Search API class .. used when custom ElkArte index is used
* SearchAPI-Custom.class.php, Custom Search API class .. used when custom ElkArte index is used
*/
class Custom_Search
{
Expand Down
2 changes: 1 addition & 1 deletion sources/subs/SearchAPI-Fulltext.class.php
Expand Up @@ -19,7 +19,7 @@
die('No access...');

/**
* SearchAPI-Fulltext.php, Fulltext API, used when an SQL fulltext index is used
* SearchAPI-Fulltext.class.php, Fulltext API, used when an SQL fulltext index is used
*/
class Fulltext_Search
{
Expand Down
4 changes: 2 additions & 2 deletions sources/subs/SearchAPI-Sphinx.class.php
Expand Up @@ -19,8 +19,8 @@
die('No access...');

/**
* SearchAPI-Sphinx.php, used when an Sphinx search daemon is used and access is via
* Sphinx native search API (SphinxAPI)
* SearchAPI-Sphinx.class.php, Sphinx API, used when an Sphinx search daemon is running
* Access is via the Sphinx native search API (SphinxAPI)
*/
class Sphinx_Search
{
Expand Down
4 changes: 2 additions & 2 deletions sources/subs/SearchAPI-Sphinxql.class.php
Expand Up @@ -19,8 +19,8 @@
die('No access...');

/**
* SearchAPI-Sphinxql.php, used when an Sphinx search daemon is used and you want to access it
* via Sphinx's own implementation of MySQL network protocol
* SearchAPI-Sphinxql.class.php, SphinxQL API, used when an Sphinx search daemon is running
* Access is via Sphinx's own implementation of MySQL network protocol (SphinxQL)
*/
class Sphinxql_Search
{
Expand Down
2 changes: 1 addition & 1 deletion sources/subs/SearchAPI-Standard.class.php
Expand Up @@ -19,7 +19,7 @@
die('No access...');

/**
* SearchAPI-Standard.php, Standard non full index, non custom index search
* SearchAPI-Standard.class.php, Standard non full index, non custom index search
*/
class Standard_Search
{
Expand Down
2 changes: 1 addition & 1 deletion themes/default/languages/Search.english.php
Expand Up @@ -85,7 +85,7 @@
$txt['search_floodcontrol_time'] = 'Time required between searches from same user';
$txt['search_floodcontrol_time_desc'] = '(0 for no limit, in seconds)';

$txt['additiona_search_engines'] = 'Additional search engines';
$txt['additional_search_engines'] = 'Additional search engines';
$txt['setup_search_engine_add_more'] = 'Add another search engine';

$txt['search_create_index'] = 'Create index';
Expand Down