Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 1 addition & 217 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,218 +1,2 @@
SphinxSearchBundle.sublime-*
.idea

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
vendor
10 changes: 0 additions & 10 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ public function getConfigTreeBuilder()
->end()
->end();

$rootNode
->children()
->arrayNode('sphinx_api')
->addDefaultsIfNotSet()
->children()
->scalarNode('file')->defaultValue(__DIR__.'../../Sphinx/SphinxAPI.php')->end()
->end()
->end()
->end();

$rootNode
->children()
->arrayNode('indexes')
Expand Down
4 changes: 0 additions & 4 deletions DependencyInjection/SphinxsearchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('iakumai.sphinxsearch.searchd.socket', $config['searchd']['socket']);
}

if (isset($config['sphinx_api'])) {
$container->setParameter('iakumai.sphinxsearch.sphinx_api.file', $config['sphinx_api']['file']);
}

if (isset($config['indexes'])) {
$container->setParameter('iakumai.sphinxsearch.indexes', $config['indexes']);
}
Expand Down
1 change: 0 additions & 1 deletion Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ services:
# Search Engine
iakumai.sphinxsearch.search:
class: %iakumai.sphinxsearch.search.class%
file: %iakumai.sphinxsearch.sphinx_api.file%
arguments:
- %iakumai.sphinxsearch.searchd.host%
- %iakumai.sphinxsearch.searchd.port%
Expand Down
23 changes: 4 additions & 19 deletions Search/Sphinxsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace IAkumaI\SphinxsearchBundle\Search;

use SphinxClient;
use Sphinx\SphinxClient;

use IAkumaI\SphinxsearchBundle\Exception\EmptyIndexException;
use IAkumaI\SphinxsearchBundle\Exception\NoSphinxAPIException;
Expand Down Expand Up @@ -83,31 +83,16 @@ class Sphinxsearch
*/
public function __construct($host, $port, $socket = null)
{
$this->host = $host;
$this->port = $port;
$this->host = $host;
$this->port = $port;
$this->socket = $socket;

if (!class_exists('SphinxClient')) {
throw new NoSphinxAPIException('You should include PHP SphinxAPI');
}

$this->sphinx = new SphinxClient();

if (!is_null($this->socket)) {
$this->sphinx->setServer($this->socket);
} else {
$this->sphinx->setServer($this->host, $this->port);
}

if (!defined('SEARCHD_OK')) {
// To prevent notice
define('SEARCHD_OK', 0);
}

if (!defined('SEARCHD_WARNING')) {
// To prevent notice
define('SEARCHD_WARNING', 3);
}
}

/**
Expand Down Expand Up @@ -161,7 +146,7 @@ public function search($query, array $indexes, $escape = true)
throw new \RuntimeException(sprintf('Searching for "%s" failed. Result with no status. Error "%s"', $query, $this->sphinx->getLastError()));
}

if ($results['status'] !== SEARCHD_OK && $results['status'] !== SEARCHD_WARNING) {
if ($results['status'] !== SphinxClient::SEARCHD_OK && $results['status'] !== SphinxClient::SEARCHD_WARNING) {
throw new \RuntimeException(sprintf('Searching for "%s" failed. Result has bad status. Error "%s"', $query, $this->sphinx->getLastError()));
}

Expand Down
Loading