Topic on Project:Support desk

ElasticSearch extension not supported for CirrusSearch Extension downloaded from latest WIKI version 1.25.1

8
Anu8791 (talkcontribs)

Hi,

I have upgraded WIKI for latest stable version 1.25.1. As MWSearch is obsolete extension so I have tried install CirrusSearch with ElasticSearch extention. But unfortunately I found below error message :

"

Warning: Invalid argument supplied for foreach() in /data/www/html/wikinew/extensions/Elastica/ElasticaConnection.php on line 78 Warning: Search backend error during fetching elasticsearch version after 2. Param host does not exist [Called from CirrusSearch\ElasticsearchIntermediary::failure in /data/www/html/wikinew/extensions/CirrusSearch/includes/ElasticsearchIntermediary.php at line 98] in /data/www/html/wikinew/includes/debug/MWDebug.php on line 300

content index...

       Fetching Elasticsearch version...unable to determine, aborting.PHP Notice:  Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53

Notice: Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53 ...Not supported! Only Elasticsearch 1.x is supported. Your version: . "

Please help to resolve the above issue.

Thanks in Adv. Sanjay

This post was posted by Anu8791, but signed as Sanjay.

Florianschmidtwelzow (talkcontribs)

It seems you haven't a running Elasticsearch server, or you haven't configured it in the configuration variable $wgCirrusSearchServers.

Anu8791 (talkcontribs)

Hi, I configured ElasticSearch Server name in variable $wgCirrusSearchServers. But when I run the script updateSearchIndexConfig.php under /extensions/CirrusSearch/maintenance and I got below Error/Warning message.


content index...

  1. PHP Warning: Invalid argument supplied for foreach() in /data/www/html/wikinew/extensions/Elastica/ElasticaConnection.php on line 78
  2. Warning: Invalid argument supplied for foreach() in /data/www/html/wikinew/extensions/Elastica/ElasticaConnection.php on line 78 Fetching Elasticsearch version...unable to determine, aborting.PHP Notice: Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53
  3. Notice: Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53
  4. ...Not supported!
  5. Only Elasticsearch 1.x is supported. Your version: .


Please suggest for the solution since it says Only Elasticsearch 1.x is supported.

Info: I have used 'CirrusSearch-REL1_25-ace4f80.tar.gz' & 'Elastica-REL1_25-eb56a6d.tar.gz'


Thank You !

Anu8791 (talkcontribs)

After I configured in the configuration variable $wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1' );

Will you please let me know what a ElasticSearch Server is? Is it the same server where I hosted MediaWIKI 1.25.1 with the extensions 'CirrusSearch-REL1_25-ace4f80.tar.gz' & 'Elastica-REL1_25-eb56a6d.tar.gz' ?

Still I get the below Err Notice after running script 'updateSearchIndexConfig.php'

content index...

  1. Fetching Elasticsearch version...unable to determine, aborting.PHP Notice: Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53
  2. Notice: Undefined index: version in /data/www/html/wikinew/extensions/CirrusSearch/includes/Maintenance/ConfigUtils.php on line 53
  3. ...Not supported!
  4. Only Elasticsearch 1.x is supported. Your version: .

Please suggest.

Thank you !

Florianschmidtwelzow (talkcontribs)

You need to install elasticsearch on a server, it's a search service. You need to install it manually using the shell, it's normally not pre-installed. If it isn't installed, you can't use CirrusSearch (CirrusSearch itself doesn't work without elasticsearch).

Anu8791 (talkcontribs)

An error has occurred while searching: We could not complete your search due to a temporary problem. Please try again later."

Below is the Log ERROR in the console while searching in WIKI...

[2015-08-04 16:23:14,493][DEBUG][action.search.type ] [Media WIKI] All shards failed for phase: [dfs] org.elasticsearch.search.SearchParseException: [wikidb_live_general_first][2]: query[filtered(((all.plain:kerberos | all:kerbero^0.5) all_near_match:kerberos)~1)->cache(namespace: namespace: namespace: namespace:

namespace: , namespace: . namespace: 0 namespace: 2 namespace: 4 namespace: 6 namespace: 8 namespace: : namespace: < namespace: > namespace: @ namespace: B namespace: D namespace: F namespace: H namespace: J namespace: L namespace: N namespace: P namespace: R namespace: T namespace: V namespace: Z namespace: \ namespace: ^ namespace: ` namespace: b namespace: d namespace: f namespace: h namespace: l namespace: p namespace: r namespace: t namespace: v namespace: z namespace: | namespace: ~ namespace:  namespace:  namespace:  namespace:  namespace: namespace:
namespace:  namespace:  namespace:  namespace:  namespace:  namespace: " namespace: & namespace: ( namespace: , namespace: 2 namespace: 4 namespace: 8 namespace: : namespace: < namespace: @ namespace: B namespace: D namespace: F namespace: H namespace: J namespace: L namespace: N namespace: P namespace: R namespace: T namespace: V namespace: X namespace: Z namespace: \)],from[-1],size[20]: Parse Failure [Failed to parse source [{"_source":["id","title","namespace","redirect.*","timestamp","text_bytes"],"fields":"text.word_count","query":{"filtered":{"query":{"bool":{"minimum_number_should_match":1,"should":[{"query_string":{"query":"kerberos","fields":["all.plain^1","all^0.5"],"auto_generate_phrase_queries":true,"phrase_slop":0,"default_operator":"AND","allow_leading_wildcard":false,"fuzzy_prefix_length":2,"rewrite":"top_terms_boost_1024"}},{"multi_match":{"fields":["all_near_match^2"],"query":"kerberos"}}]}},"filter":{"terms":{"namespace":[0,2,4,12,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,346,348,350,352,354,356,358,360,364,368,370,372,374,378,380,382,384,386,388,390,392,396,400,404,406,408,410,418,422,424,428,434,436,440,442,444,448,450,452,454,456,458,460,462,464,466,468,470,472,474,476]}}}},"highlight":{"pre_tags":["<span class=\"searchmatch\">"],"post_tags":[""],"fields":{"title":{"number_of_fragments":0,"type":"fvh","order":"score","matched_fields":["title","title.plain"]},"redirect.title":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["redirect.title","redirect.title.plain"]},"category":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["category","category.plain"]},"heading":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["heading","heading.plain"]},"text":{"number_of_fragments":1,"fragment_size":150,"type":"fvh","order":"score","no_match_size":150,"matched_fields":["text","text.plain"]},"auxiliary_text":{"number_of_fragments":1,"fragment_size":150,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["auxiliary_text","auxiliary_text.plain"]}},"highlight_query":{"query_string":{"query":"kerberos","fields":["title.plain^20","redirect.title.plain^15","category.plain^8","heading.plain^5","opening_text.plain^3","text.plain^1","auxiliary_text.plain^0.5","title^10","redirect.title^7.5","category^4","heading^2.5","opening_text^1.5","text^0.5","auxiliary_text^0.25"],"auto_generate_phrase_queries":true,"phrase_slop":1,"default_operator":"AND","allow_leading_wildcard":false,"fuzzy_prefix_length":2,"rewrite":"top_terms_boost_1024"}}},"suggest":{"text":"kerberos","suggest":{"phrase":{"field":"suggest","size":1,"max_errors":2,"confidence":2,"direct_generator":[{"field":"suggest","suggest_mode":"always","max_term_freq":0.5,"prefix_length":2}],"highlight":{"pre_tag":"","post_tag":""}}}},"stats":["suggest","full_text"],"size":20,"rescore":[{"window_size":8192,"query":{"rescore_query":{"function_score":{"functions":[{"script_score":{"script":"log10((doc['incoming_links'].isEmpty() ? 0 : doc['incoming_links'].value) + 2)","lang":"groovy"}},{"boost_factor":"0.05","filter":{"terms":{"namespace":[2]}}},{"boost_factor":"0.1","filter":{"terms":{"namespace":[4,12]}}},{"boost_factor":"0.2","filter":{"terms":{"namespace":[300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,346,348,350,352,354,356,358,360,364,368,370,372,374,378,380,382,384,386,388,390,392,396,400,404,406,408,410,418,422,424,428,434,436,440,442,444,448,450,452,454,456,458,460,462,464,466,468,470,472,474,476]}}}]}},"query_weight":1,"rescore_query_weight":1,"score_mode":"multiply"}}]}]]
       at org.elasticsearch.search.SearchService.parseSource(SearchService.java:747)
       at org.elasticsearch.search.SearchService.createContext(SearchService.java:572)
       at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:544)
       at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:223)
       at org.elasticsearch.search.action.SearchServiceTransportAction$3.call(SearchServiceTransportAction.java:197)
       at org.elasticsearch.search.action.SearchServiceTransportAction$3.call(SearchServiceTransportAction.java:194)
       at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)

Caused by: org.elasticsearch.index.query.QueryParsingException: [wikidb_live_general_first] script_score the script could not be loaded

       at org.elasticsearch.index.query.functionscore.script.ScriptScoreFunctionParser.parse(ScriptScoreFunctionParser.java:93)
       at org.elasticsearch.index.query.functionscore.FunctionScoreQueryParser.parseFiltersAndFunctions(FunctionScoreQueryParser.java:217)
       at org.elasticsearch.index.query.functionscore.FunctionScoreQueryParser.parse(FunctionScoreQueryParser.java:122)
       at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:305)
       at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:382)
       at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:281)
       at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:276)
       at org.elasticsearch.search.rescore.QueryRescorer.parse(QueryRescorer.java:189)
       at org.elasticsearch.search.rescore.RescoreParseElement.parseSingleRescoreContext(RescoreParseElement.java:59)
       at org.elasticsearch.search.rescore.RescoreParseElement.parse(RescoreParseElement.java:37)
       at org.elasticsearch.search.SearchService.parseSource(SearchService.java:731)
       ... 9 more

Caused by: org.elasticsearch.script.ScriptException: scripts of type [inline], operation [search] and lang [groovy] are disabled

       at org.elasticsearch.script.ScriptService.compile(ScriptService.java:285)
       at org.elasticsearch.script.ScriptService.search(ScriptService.java:483)
       at org.elasticsearch.index.query.functionscore.script.ScriptScoreFunctionParser.parse(ScriptScoreFunctionParser.java:90)
       ... 19 more


Please provide a solution to the above ERROR !

Thanks in Adv. Sanjay

Anu8791 (talkcontribs)

I have installed elasticsearch 1.7.0 as a service after updating jdk version "1.8.0_51" I can able to access the service through the default port 9200 or by using curl.

Below is the set of configuration on my 'LocalSettings.php'

  1. require_once( "$IP/extensions/Elastica/Elastica.php" );
  2. require_once( "$IP/extensions/CirrusSearch/CirrusSearch.php" );
  3. $wgCirrusSearchServers = array( 'example.domain.com' );
  4. $wgSearchType = 'CirrusSearch';

And I am getting below error on console while searching through WIKI search interface.

[2015-08-04 15:39:51,526][DEBUG][action.search.type ] [Media WIKI] [wikidb_live_general_first][1], node[DfJ96ZPaRr-eov4RMRaEXg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@163deda7] lastShard [true] org.elasticsearch.search.SearchParseException: [wikidb_live_general_first][1]: query[filtered(((all.plain:apache | all:apache^0.5) all_near_match:apache)~1)->cache(namespace: namespace: namespace: namespace:

namespace: , namespace: . namespace: 0 namespace: 2 namespace: 4 namespace: 6 namespace: 8 namespace: : namespace: < namespace: > namespace: @ namespace: B namespace: D namespace: F namespace: H namespace: J namespace: L namespace: N namespace: P namespace: R namespace: T namespace: V namespace: Z namespace: \ namespace: ^ namespace: ` namespace: b namespace: d namespace: f namespace: h namespace: l namespace: p namespace: r namespace: t namespace: v namespace: z namespace: | namespace: ~ namespace:  namespace:  namespace:  namespace:  namespace: namespace:
namespace:  namespace:  namespace:  namespace:  namespace:  namespace: " namespace: & namespace: ( namespace: , namespace: 2 namespace: 4 namespace: 8 namespace: : namespace: < namespace: @ namespace: B namespace: D namespace: F namespace: H namespace: J namespace: L namespace: N namespace: P namespace: R namespace: T namespace: V namespace: X namespace: Z namespace: \)],from[-1],size[20]: Parse Failure [Failed to parse source [{"_source":["id","title","namespace","redirect.*","timestamp","text_bytes"],"fields":"text.word_count","query":{"filtered":{"query":{"bool":{"minimum_number_should_match":1,"should":[{"query_string":{"query":"apache","fields":["all.plain^1","all^0.5"],"auto_generate_phrase_queries":true,"phrase_slop":0,"default_operator":"AND","allow_leading_wildcard":false,"fuzzy_prefix_length":2,"rewrite":"top_terms_boost_1024"}},{"multi_match":{"fields":["all_near_match^2"],"query":"apache"}}]}},"filter":{"terms":{"namespace":[0,2,4,12,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,346,348,350,352,354,356,358,360,364,368,370,372,374,378,380,382,384,386,388,390,392,396,400,404,406,408,410,418,422,424,428,434,436,440,442,444,448,450,452,454,456,458,460,462,464,466,468,470,472,474,476]}}}},"highlight":{"pre_tags":["<span class=\"searchmatch\">"],"post_tags":[""],"fields":{"title":{"number_of_fragments":0,"type":"fvh","order":"score","matched_fields":["title","title.plain"]},"redirect.title":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["redirect.title","redirect.title.plain"]},"category":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["category","category.plain"]},"heading":{"number_of_fragments":1,"fragment_size":10000,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["heading","heading.plain"]},"text":{"number_of_fragments":1,"fragment_size":150,"type":"fvh","order":"score","no_match_size":150,"matched_fields":["text","text.plain"]},"auxiliary_text":{"number_of_fragments":1,"fragment_size":150,"type":"fvh","order":"score","options":{"skip_if_last_matched":true},"matched_fields":["auxiliary_text","auxiliary_text.plain"]}},"highlight_query":{"query_string":{"query":"apache","fields":["title.plain^20","redirect.title.plain^15","category.plain^8","heading.plain^5","opening_text.plain^3","text.plain^1","auxiliary_text.plain^0.5","title^10","redirect.title^7.5","category^4","heading^2.5","opening_text^1.5","text^0.5","auxiliary_text^0.25"],"auto_generate_phrase_queries":true,"phrase_slop":1,"default_operator":"AND","allow_leading_wildcard":false,"fuzzy_prefix_length":2,"rewrite":"top_terms_boost_1024"}}},"suggest":{"text":"apache","suggest":{"phrase":{"field":"suggest","size":1,"max_errors":2,"confidence":2,"direct_generator":[{"field":"suggest","suggest_mode":"always","max_term_freq":0.5,"prefix_length":2}],"highlight":{"pre_tag":"","post_tag":""}}}},"stats":["suggest","full_text"],"size":20,"rescore":[{"window_size":8192,"query":{"rescore_query":{"function_score":{"functions":[{"script_score":{"script":"log10((doc['incoming_links'].isEmpty() ? 0 : doc['incoming_links'].value) + 2)","lang":"groovy"}},{"boost_factor":"0.05","filter":{"terms":{"namespace":[2]}}},{"boost_factor":"0.1","filter":{"terms":{"namespace":[4,12]}}},{"boost_factor":"0.2","filter":{"terms":{"namespace":[300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,346,348,350,352,354,356,358,360,364,368,370,372,374,378,380,382,384,386,388,390,392,396,400,404,406,408,410,418,422,424,428,434,436,440,442,444,448,450,452,454,456,458,460,462,464,466,468,470,472,474,476]}}}]}},"query_weight":1,"rescore_query_weight":1,"score_mode":"multiply"}}]}]]
       at org.elasticsearch.search.SearchService.parseSource(SearchService.java:747)
       at org.elasticsearch.search.SearchService.createContext(SearchService.java:572)
       at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:544)
       at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:223)
       at org.elasticsearch.search.action.SearchServiceTransportAction$3.call(SearchServiceTransportAction.java:197)
       at org.elasticsearch.search.action.SearchServiceTransportAction$3.call(SearchServiceTransportAction.java:194)
       at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)

Caused by: org.elasticsearch.index.query.QueryParsingException: [wikidb_live_general_first] script_score the script could not be loaded

       at org.elasticsearch.index.query.functionscore.script.ScriptScoreFunctionParser.parse(ScriptScoreFunctionParser.java:93)
       at org.elasticsearch.index.query.functionscore.FunctionScoreQueryParser.parseFiltersAndFunctions(FunctionScoreQueryParser.java:217)
       at org.elasticsearch.index.query.functionscore.FunctionScoreQueryParser.parse(FunctionScoreQueryParser.java:122)
       at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:305)
       at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:382)
       at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:281)
       at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:276)
       at org.elasticsearch.search.rescore.QueryRescorer.parse(QueryRescorer.java:189)
       at org.elasticsearch.search.rescore.RescoreParseElement.parseSingleRescoreContext(RescoreParseElement.java:59)
       at org.elasticsearch.search.rescore.RescoreParseElement.parse(RescoreParseElement.java:37)
       at org.elasticsearch.search.SearchService.parseSource(SearchService.java:731)
       ... 9 more

Caused by: org.elasticsearch.script.ScriptException: scripts of type [inline], operation [search] and lang [groovy] are disabled

       at org.elasticsearch.script.ScriptService.compile(ScriptService.java:285)
       at org.elasticsearch.script.ScriptService.search(ScriptService.java:483)
       at org.elasticsearch.index.query.functionscore.script.ScriptScoreFunctionParser.parse(ScriptScoreFunctionParser.java:90)
       ... 19 more

Please provide the appropriate solution to the above error.

Thanks in Adv, Sanjay

Florianschmidtwelzow (talkcontribs)
Reply to "ElasticSearch extension not supported for CirrusSearch Extension downloaded from latest WIKI version 1.25.1"