kdyby / elasticsearch Goto Github PK
View Code? Open in Web Editor NEWIntegration of Elastica for ElasticSearch into Nette Framework
Home Page: https://packagist.org/packages/kdyby/elastic-search
License: Other
Integration of Elastica for ElasticSearch into Nette Framework
Home Page: https://packagist.org/packages/kdyby/elastic-search
License: Other
The current one is okey, but there is surely a better way to represent the data.
The request is collapsible, for better readability
The title "Request" is in fact a link, that you can "Right click > copy adress link" and this is the output:
json:{"query":{"filtered":{"query":{"query_string":{"query":"ml%C3%A9ko","default_operator":"AND"}},"filter":{"bool":{"must":[{"term":{"enable":true}},{"term":{"deleted":false}},{"range":{"inventoryAmount":{"gt":0}}}]}}}},"from":0,"size":30,"_source":false}
I also don't like how there is the json:
, you have to delete those first 5 symbols, to be able to use it in _head
plugin, but hey, we're almost there!
With some flash plugin, we should be able to put the content directly to clipboard. Also having console curl and other elastic management plugins commands that could be copied and executed easily.
The result of search queries is displayed like this
Other request are just Response:
and clickable structure.
Would be great to tag repository before BC break like drop support for PHP 5.6 or BC break in elastica.
At this moment there is no tagged version of working dev-master.
Thanks
Current version in composer.json (~2.1.0) of Elastica does not support ElasticSearch 2.2.0 Is possible to make a new release of Kdyby/ElasticSearch with dependency to 3.1.0 ?
Usage
$result = $this->elastica->request('/firmy/Account/55e70527b6683b2d7290a34d');
Error:
Fatal error: Call to undefined function Kdyby\ElasticSearch\Diagnostics\callback()
in D:\projects\test\elasticsearch\vendor\kdyby\elastic-search\src\Kdyby\ElasticSearch\Diagnostics\Panel.php on line 81
Call Stack: 0.2320 6145760
1. Tracy\Debugger::shutdownHandler() D:\projects\test\elasticsearch\vendor\tracy\tracy\src\Tracy\Debugger.php:0 0.2330 6146640
2. Tracy\Bar->render() D:\projects\test\elasticsearch\vendor\tracy\tracy\src\Tracy\Debugger.php:207 0.2380 6207344
3. Kdyby\ElasticSearch\Diagnostics\Panel->getPanel() D:\projects\test\elasticsearch\vendor\tracy\tracy\src\Tracy\Bar.php:73
composer.json
{
"name": "nette/sandbox",
"description": "The sandbox is a pre-packaged Nette Framework project, basic configured structure for your application.",
"homepage": "http://nette.org",
"type": "project",
"license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
"authors": [
{
"name": "David Grudl",
"homepage": "http://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "http://nette.org/contributors"
}
],
"require": {
"php": ">= 5.3.7",
"nette/application": "~2.3.0",
"nette/bootstrap": "~2.3.0",
"nette/caching": "~2.3.0",
"nette/database": "~2.3.0",
"nette/di": "~2.3.0",
"nette/finder": "~2.3.0",
"nette/forms": "~2.3.0",
"nette/http": "~2.3.0",
"nette/mail": "~2.3.0",
"nette/robot-loader": "~2.3.0",
"nette/safe-stream": "~2.3.0",
"nette/security": "~2.3.0",
"nette/utils": "~2.3.0",
"latte/latte": "~2.3.0",
"tracy/tracy": "~2.3.0",
"dg/adminer-custom": "~1.6",
"kdyby/elastic-search": "^1.1"
},
"require-dev": {
"nette/tester": "~1.3"
}
}
System info
Execution time 219.0 ms
Peak of allocated memory 6.07 MB
Included files 179
Classes + interfaces + traits 337 + 45 + 0
Your IP 127.0.0.1
Server IP 127.0.0.1
PHP 5.6.12
Tracy 2.3.4
Server Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12
219.0 ms
Homepage:default
Version 7 is already supported by ruflin/elastica: ~7.0
. Notable changes:
request
method in client
Write also some integration tests for ruflin/Elastica#702.
Please take a nwe link for documentation
elastica client expects curl options as key => value directly put into curl_setopt :
foreach ($this->getConnection()->getConfig('curl') as $key => $param) {
curl_setopt($curlConnection, $key, $param);
}
This is not possible as keys are CURLOPT_* constants which are integer and Config::merge helper reindexes arrays with integer keys:
DI builder users Config\Helpers::merge to build configuration array :
https://github.com/Kdyby/ElasticSearch/blob/master/src/Kdyby/ElasticSearch/DI/SearchExtension.php#L69
Helpers::merge reindexes array if keys are integers :
https://github.com/nette/di/blob/master/src/DI/Config/Helpers.php#L28-L29
Secondary issue is that just putting those constants in config is pain because ::constant(...) is not valid array key in neon syntax.
Therefore I would love to have option of using string constants, possibly same as in Kdyby/Curl - using just part after CURLOPT_ : $constant = 'CURLOPT_' . strtoupper($option)
which would be processed in during config build to correct array of parameters for elastica
I think the title is self-explaining. It should be mostly about adapting to the newer version of the DI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.