Understanding Solr Function Query Performanceusing OR and NOT in solr queryElasticSearch, Sphinx, Lucene, Solr, Xapian. Which fits for which usage?NoSQL (MongoDB) vs Lucene (or Solr) as your databaseHow to query SOLR for empty fields?Solr * vs *:* query performanceSolr Query with LIKE ClauseSolr vs. ElasticSearchDifference between solr and luceneSolr/Lucene query lemmatization with contextSOLR 6.6 eDisMax query not respecting mm parameter

Why doesn't philosophy have higher standards for its arguments?

Data Filters and Measures Error for Unique Opens

If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?

How to determine the optimal threshold to achieve the highest accuracy

Can a pizza stone be fixed after soap has been used to clean it?

How to ask my office to remove the pride decorations without appearing anti-LGBTQ?

Unix chat server making communication between terminals possible

Do aircraft cabins have suspension?

Finding the package which provides a given command

Mechanical puzzle ID: Ring, barbell, and four-holed panel

What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?

Can I remove the doors before installing a sliding patio doors frame?

Do dragons smell of lilacs?

Cine footage fron Saturn V launch's

Did Voldemort kill his father before finding out about Horcruxes?

What impact would a dragon the size of Asia have on the environment?

Why is Katakana not pronounced Katagana?

Why does "git status" show I'm on the master branch and "git branch" does not?

Manually select/unselect lines before forwarding to stdout

Why isn't aluminium involved in biological processes?

What happens on Day 6?

How Efficient Could Anaerobic Megafauna Be?

Why did Steve Rogers choose this character in Endgame?

What powers the air required for pneumatic brakes in aircraft?



Understanding Solr Function Query Performance


using OR and NOT in solr queryElasticSearch, Sphinx, Lucene, Solr, Xapian. Which fits for which usage?NoSQL (MongoDB) vs Lucene (or Solr) as your databaseHow to query SOLR for empty fields?Solr * vs *:* query performanceSolr Query with LIKE ClauseSolr vs. ElasticSearchDifference between solr and luceneSolr/Lucene query lemmatization with contextSOLR 6.6 eDisMax query not respecting mm parameter






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm working with "edismax" and "function-query" parsers in Solr and have difficulty in understanding whether the query time taken by "function-query" makes sense. The query I'm trying to optimize looks as follows:




q=!func sum($q1,$q2,$q3) where q1,q2,q3 are edismax queries.




The QTime returned by edismax queries takes well under 50ms but it seems that function-query is the rate determining step since combined query above takes around 200-300ms. I also analyzed the performance of function query using only constants.



The QTime results for different q are as follows:



  • 097ms for q=!func sum(10,20)


  • 109ms for q=!func sum(10,20,30)


  • 127ms for q=!func sum(10,20,30,40)


  • 145ms for q=!func sum(10,20,30,40,50)


Does this trend make sense? Are function-queries expected to be this slow?



What makes edismax queries so much faster?



What can I do to optimize my original query (which has edismax subqueries q1,q2,q3) to work under 100ms?










share|improve this question




























    1















    I'm working with "edismax" and "function-query" parsers in Solr and have difficulty in understanding whether the query time taken by "function-query" makes sense. The query I'm trying to optimize looks as follows:




    q=!func sum($q1,$q2,$q3) where q1,q2,q3 are edismax queries.




    The QTime returned by edismax queries takes well under 50ms but it seems that function-query is the rate determining step since combined query above takes around 200-300ms. I also analyzed the performance of function query using only constants.



    The QTime results for different q are as follows:



    • 097ms for q=!func sum(10,20)


    • 109ms for q=!func sum(10,20,30)


    • 127ms for q=!func sum(10,20,30,40)


    • 145ms for q=!func sum(10,20,30,40,50)


    Does this trend make sense? Are function-queries expected to be this slow?



    What makes edismax queries so much faster?



    What can I do to optimize my original query (which has edismax subqueries q1,q2,q3) to work under 100ms?










    share|improve this question
























      1












      1








      1








      I'm working with "edismax" and "function-query" parsers in Solr and have difficulty in understanding whether the query time taken by "function-query" makes sense. The query I'm trying to optimize looks as follows:




      q=!func sum($q1,$q2,$q3) where q1,q2,q3 are edismax queries.




      The QTime returned by edismax queries takes well under 50ms but it seems that function-query is the rate determining step since combined query above takes around 200-300ms. I also analyzed the performance of function query using only constants.



      The QTime results for different q are as follows:



      • 097ms for q=!func sum(10,20)


      • 109ms for q=!func sum(10,20,30)


      • 127ms for q=!func sum(10,20,30,40)


      • 145ms for q=!func sum(10,20,30,40,50)


      Does this trend make sense? Are function-queries expected to be this slow?



      What makes edismax queries so much faster?



      What can I do to optimize my original query (which has edismax subqueries q1,q2,q3) to work under 100ms?










      share|improve this question














      I'm working with "edismax" and "function-query" parsers in Solr and have difficulty in understanding whether the query time taken by "function-query" makes sense. The query I'm trying to optimize looks as follows:




      q=!func sum($q1,$q2,$q3) where q1,q2,q3 are edismax queries.




      The QTime returned by edismax queries takes well under 50ms but it seems that function-query is the rate determining step since combined query above takes around 200-300ms. I also analyzed the performance of function query using only constants.



      The QTime results for different q are as follows:



      • 097ms for q=!func sum(10,20)


      • 109ms for q=!func sum(10,20,30)


      • 127ms for q=!func sum(10,20,30,40)


      • 145ms for q=!func sum(10,20,30,40,50)


      Does this trend make sense? Are function-queries expected to be this slow?



      What makes edismax queries so much faster?



      What can I do to optimize my original query (which has edismax subqueries q1,q2,q3) to work under 100ms?







      search solr lucene information-retrieval edismax






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 8:18









      sidharth228sidharth228

      206 bronze badges




      206 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          func query enumerates all docs, thus it doesn't provide any selectivity. You probably don't need to evaluate it on docs, which doesn't match dismaxes eg



          q=+!v=$q1 +!v=$q2 +!v=$q3 !func sum($q1,$q2,$q3)





          share|improve this answer























          • This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

            – sidharth228
            Apr 11 at 10:08












          • pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

            – mkhludnev
            Apr 15 at 13:13










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55352565%2funderstanding-solr-function-query-performance%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          func query enumerates all docs, thus it doesn't provide any selectivity. You probably don't need to evaluate it on docs, which doesn't match dismaxes eg



          q=+!v=$q1 +!v=$q2 +!v=$q3 !func sum($q1,$q2,$q3)





          share|improve this answer























          • This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

            – sidharth228
            Apr 11 at 10:08












          • pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

            – mkhludnev
            Apr 15 at 13:13















          0














          func query enumerates all docs, thus it doesn't provide any selectivity. You probably don't need to evaluate it on docs, which doesn't match dismaxes eg



          q=+!v=$q1 +!v=$q2 +!v=$q3 !func sum($q1,$q2,$q3)





          share|improve this answer























          • This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

            – sidharth228
            Apr 11 at 10:08












          • pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

            – mkhludnev
            Apr 15 at 13:13













          0












          0








          0







          func query enumerates all docs, thus it doesn't provide any selectivity. You probably don't need to evaluate it on docs, which doesn't match dismaxes eg



          q=+!v=$q1 +!v=$q2 +!v=$q3 !func sum($q1,$q2,$q3)





          share|improve this answer













          func query enumerates all docs, thus it doesn't provide any selectivity. You probably don't need to evaluate it on docs, which doesn't match dismaxes eg



          q=+!v=$q1 +!v=$q2 +!v=$q3 !func sum($q1,$q2,$q3)






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 9 at 11:22









          mkhludnevmkhludnev

          1671 silver badge5 bronze badges




          1671 silver badge5 bronze badges












          • This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

            – sidharth228
            Apr 11 at 10:08












          • pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

            – mkhludnev
            Apr 15 at 13:13

















          • This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

            – sidharth228
            Apr 11 at 10:08












          • pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

            – mkhludnev
            Apr 15 at 13:13
















          This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

          – sidharth228
          Apr 11 at 10:08






          This doesn't work for me. Solr attempts to parse this entire string (using the deault parser) as if it were a keyword. Are you sure about this syntax, because from what I gather, a parser name should follow the "!" and it seems that Solr expects a string for the "v" parameter.

          – sidharth228
          Apr 11 at 10:08














          pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

          – mkhludnev
          Apr 15 at 13:13





          pls provide the response with debugQuery=true. Also try with q=%2b!v=$q1 %2b!v=$q2 %2b!v=$q3 !func sum($q1,$q2,$q3)

          – mkhludnev
          Apr 15 at 13:13








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55352565%2funderstanding-solr-function-query-performance%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript