Coder Social home page Coder Social logo

Comments (10)

chriseldredge avatar chriseldredge commented on July 20, 2024

Sorry for the delayed response. There have been plenty of bug fixes since 0.9.0 and current release is 1.6.2. I'm not going to back port any fixes so please upgrade and let me know if you still have problems.

from klondike.

dustinsoftware avatar dustinsoftware commented on July 20, 2024

Thanks for the response! I updated, and unfortunately, the same issue is still occurring. The stack trace is the same in the error log.

from klondike.

chriseldredge avatar chriseldredge commented on July 20, 2024

Thanks for testing again. If you don't mind, could you also try the build from https://ci.appveyor.com/project/chriseldredge/klondike/build/artifacts?

That's going to be the next release when I get around to finishing it up.

Some LINQ / Lucene stuff has been fixed recently.

from klondike.

dustinsoftware avatar dustinsoftware commented on July 20, 2024

OK, I updated to the build you linked to. This time, I get a different error:

<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <m:code />
  <m:message xml:lang="en-US">The query specified in the URI is not valid. Only ordering by properties is supported for non-primitive collections. Expressions are not supported.</m:message>
  <m:innererror>
    <m:message>Only ordering by properties is supported for non-primitive collections. Expressions are not supported.</m:message>
    <m:type>Microsoft.Data.OData.ODataException</m:type>
    <m:stacktrace>   at System.Web.Http.OData.Query.OrderByPropertyNode..ctor(OrderByClause orderByClause)&#xD;
   at System.Web.Http.OData.Query.OrderByNode.CreateCollection(OrderByClause orderByClause)&#xD;
   at System.Web.Http.OData.Query.OrderByQueryOption.get_OrderByNodes()&#xD;
   at System.Web.Http.OData.Query.OrderByQueryOption.ApplyToCore(IQueryable query, ODataQuerySettings querySettings)&#xD;
   at System.Web.Http.OData.Query.ODataQueryOptions.ApplyTo(IQueryable query, ODataQuerySettings querySettings)&#xD;
   at System.Web.Http.OData.EnableQueryAttribute.ExecuteQuery(Object response, HttpRequestMessage request, HttpActionDescriptor actionDescriptor)&#xD;
   at System.Web.Http.OData.EnableQueryAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)</m:stacktrace>
  </m:innererror>
</m:error>

from klondike.

chriseldredge avatar chriseldredge commented on July 20, 2024

Okay, I'm just noticing that the $orderby is:

(DownloadCount > 300) and
    (substringof('foo',Title) or
     substringof('foo',Id)) desc,
DownloadCount desc

Evidently WebApi OData does not support expressions like this in an ordering clause. There's not much I can do about this.

If you explain what this is trying to accomplish I may be able to suggest an alternate approach.

from klondike.

chriseldredge avatar chriseldredge commented on July 20, 2024

By the way, even if OData allowed that, the underlying LINQ implementation (Lucene.Net.Linq) will not, because Lucene.Net only supports sorting by indexed fields without additional logic.

Incidentally, Klondike already boosts matches in Id or Title above matches in other fields, and boosts packages with higher download counts, so omitting the $orderby parameter may return results in an acceptable order.

from klondike.

dustinsoftware avatar dustinsoftware commented on July 20, 2024

Ah, very interesting. For context, this is the query generated by Linqpad's built in NuGet browser. The VS NuGet extension does not seem to have this problem. Thanks for looking into this!

from klondike.

piers7 avatar piers7 commented on July 20, 2024

I was having the same problem, also from Linqpad.
Problem goes away if you change the 'Sort By' column in linqpad to something other than 'relevance', which presumably then generates a simpler (or at least lucene-compliant) order by in the odata.

from klondike.

chriseldredge avatar chriseldredge commented on July 20, 2024

Has someone reported this issue to the Linqpad support team? I have a feeling this type of ordering clause, even if it works with NuGet Gallery today, is non-standard and likely to cause problems. I would argue that Linqpad should not be trying to influence the order of results in such a complicated way and that the server that hosts the packages is probably better informed about the relevance of fuzzy search results.

from klondike.

piers7 avatar piers7 commented on July 20, 2024

Yes, I raised a bug with Linqpad support. But I'll forward your comments to him too.

from klondike.

Related Issues (20)

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.