Giter VIP home page Giter VIP logo

opensearchserver-php-client's People

Contributors

alexandretoyer avatar emmanuel-keller avatar schmunk42 avatar theunic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensearchserver-php-client's Issues

include_once => require_once

In README.md, it would be better to write require_once:

echo "<?php include_once '../vendor/autoload.php';" > index.php

Bug on oss_search_abstract

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,

Sending patterns and urls to the instance does not mean they will be crawled?

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:

  • Inject url list OpenSearchServer\Document\Put();
  • Inject those URLs as allowed path/s OpenSearchServer\Crawler\Web\Patterns\Inclusion\Insert();
  • and also to do a crawl request on each URL OpenSearchServer\Crawler\Web\Crawl();

Am I missing something?

Missing fields in response when Buzz follows 301 redirect

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.

Problems setting up

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?

ability to add more CURLOPT

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

php-client throws non-oss exceptions

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

Paging of results

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?

Fatal error on composer update

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.

Filter by additional fields listed in the URL browser

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

add getter to access OpenSearchServer\Document\Document fields

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

Make Client PHP7 ready

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

stored value in create a field method

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.