jaeksoft / opensearchserver-php-client Goto Github PK
View Code? Open in Web Editor NEWOpenSearchServer PHP Client
License: Apache License 2.0
OpenSearchServer PHP Client
License: Apache License 2.0
Hi,
Is there anyway in getting the number of documents in an Index?
Also, once I invoke a function for Build the autocompletion, How can I get the total number of items in the Autocompletion?
In README.md, it would be better to write require_once:
echo "<?php include_once '../vendor/autoload.php';" > index.php
Hello,
I would like to report a bug and a fix. The issue is on class: oss_search_abstract.class line 79.
I think you have a signature mismatch on method:
$result = $this->queryServerXML(OssSearch::API_SELECT, $params, $connectTimeOut, $timeOut);
where it should be something like:
$result = $this->queryServerXML(OssSearch::API_SELECT, $params, null, $connectTimeOut, $timeOut);
The problem $timeOut param should be sent in 5th place instead of current 4th.
Regards,
When sending the allowed patterns and the URL list to the instance/index, does not start the crawl process on that list. I had to use the OpenSearchServer\Crawler\Web\Crawl() request to actually start the crawl process on that list of URLs. Just injecting the urls and setting the allowed patterns doesn't guarantee that those URL will be processed as configured in the running index.
I thought just by injecting urls and setting them as allowed patterns, the instance will process them.
So, to index some urls I have to do as follows:
Am I missing something?
I came across the problem that the fields are missing in a search response when using a http url of a host that redirects to https. In this case the documents in the answer look normal like this:
"documents":[{"pos":0,"score":1.0,"collapseCount":0},{"pos" [...]
but the "fields" attribute is missing.
This is due to Buzz following the redirect because of CURLOPT_FOLLOWLOCATION, but the request body is missing in the subsequent requests. CURLOPT_FOLLOWLOCATION switches from POST to GET requests, so the POST body is lost due to the default CURLOPT_POSTREDIR setting.
I made a PR in the Buzz repo that addresses this issue.
In https://github.com/jaeksoft/opensearchserver-php-client/blob/master/src/OpenSearchServer/Handler.php#L72, a method is called to add some credentials to the API url, but the method getURLStringCredentials () does not return any value..... is there any need to call this method?
Hi. It isn't very clear regarding how to set up the application regarding creation of the handler (or, it may not be working for me). Is it supposed to be:
//initiate API wrapper
$app_key = '54a51ee4f27cbbcb7a771352b980567f';
$login = 'admin';
new OpenSearchServer\Handler(array('key' => $app_key, 'login' => $login ));
Or, am I supposed to not use the term Handler and place something else there?
When I run this, I get the following error:
Class 'OpenSearchServer\Handler' not found
I see there are a number of files in src. Am I supposed to include all of these files?
Hi,
I need to add CURLOPT_SSL_VERIFYHOST to 0 to le curl client options, and maybe more.
Is it possible to add it or to allow Handler::init() to accept curl options ?
class Handler:
public function __construct(array $options = array(), array $curl_options= array()) {
...
$this->init($curl_options);
...
protected function init($curl_options)
...
foreach($curl_option as $option=>$value) {
$client->setOption( $option, $value);
}
$this->client = $client;
$this->browser = new Browser($client);
regards
http://www.opensearchserver.com/documentation/api_v2/WEB_crawler/start.md says there is an option to run the crawler once and not forever. The PHP Client does not support this
I get some Buzz\Exception\RequestException when the php client cannot connect to OSS (maintenance period, ie)
Exception from line 29 of ossphp/vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php:
Failed to connect to localhost port 8080: Connection refused
Couldn't this be an OpenSearchServer exception ? I think it would be better for api stability to handle exceptions coming from client/oss dialog
regards
Is it possible to use the client for the REST-API?
We are currently use OSS v1.5.3 and in this version the is XML-API deprecated.
In OSS PHP's "previous version" documentation, it talks about pagination of results.
Why is this absent from the current version?
Or, if it isn't, where's the documentation on how to use it?
On composer update
, the dependency kriswallsmith/buzz
is updated to 0.17.1
. This causes the following fatal error, rending site search entirely broken:
PHP Fatal error: Uncaught Error: Call to undefined method Buzz\Client\Curl::setVerifyPeer() in /[..]/vendor/opensearchserver/opensearchserver/src/OpenSearchServer/Handler.php:41
A quick fix is to fork and force version 0.16.0
, however setVerifyPeer()
needs to be factored out of the component.
We'd like to filter results based on the Fetch status listed in the URL browser, but that does not work in our context. Through
$request->negativeFilter('fetch:Gone');
I had expected that no rows with that status were returned, but that is not the case. Is there any other way to filter for this state or the HTTP status code of a document?
Background: currently, we have a lot of 404 documents in the index which should not be returned. Yes, we will also adjust the index through scheduled jobs, but adjusting it this way takes more time as we use a lot of indices
It would be great to have fields accessor in OpenSearchServer\Document\Document.
We need this to inspect document content while processing exceptions (and to save document unique field for future processing, for example)
No way to access the "fields" protected property for now.
Regards
Currently, I'm testing our application for PHP7 compatibility. One of your classes throws an error: in ResponseFactory, line 71, there is a lost break statement
It would be nice to be able to use this library through composer, and be listed at packagist (https://packagist.org/) as well.
Thanks.
Hi
stored value keys "true" or "false" typed in your document
this is not working
I've tried as, its working : (->stored('YES'))
$request = new OpenSearchServer\Field\Create(); $request->index('index_name') ->name('titleStandard') ->indexed(true) ->analyzer('StandardAnalyzer') ->stored('YES') ->copyOf('title'); $response = $oss_api->submit($request)
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.