Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeffrey Veer 41 posts 308 karma points
    Oct 27, 2022 @ 11:30
    Jeffrey Veer
    0

    SearchOrders 'HasTag'

    Hi,

    I am trying to retrieve all orders with a certain tag, for this I use the SearchOrders function in the OrderService as below:

    _orderService.SearchOrders(o => o.HasTag("xxxxx")).Items;
    

    However, this returns all orders that have any tag. I checked a bit in the code and it seems to be in the SqlKataQueryOrderSpecificationVisitor, as this is used to build the query for the OrderHasTagSpecification.

    Because the Visit function doesn't take the 'tag' parameter into account and only checks if there is any tag set on the order (which would be the regular HasTag()).

    Is this a bug, or am I completely missing something?

    One other question, do you have any idea if we can implement our own SearchSpecification's for the order? We would like to combine a few additional checks.

    Thanks in advance!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 27, 2022 @ 14:32
    Matt Brailsford
    0

    Hey Jeffrey,

    It sounds like it's a bug yea. I'll take a look at adding the filter with the term

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 27, 2022 @ 14:53
    Matt Brailsford
    100

    Ok, there should be a 3.0.4-beta0003 on our unstable feed at https://nuget.outfield.digital/unstable/vendr/v3/index.json

    Do you want to install that and test that it does indeed fix your problem?

  • Jeffrey Veer 41 posts 308 karma points
    Oct 27, 2022 @ 14:58
    Jeffrey Veer
    0

    Hi Matt,

    Awesome for the quick fix, I've just tested it and it works as expected for us.

    Thank you very much once again!

    For the other question, do you know if it's possible for us to extend the SearchSpecifications? We can easily workaround if it isn't possible, no pressure there, haha!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 27, 2022 @ 15:02
    Matt Brailsford
    1

    Hi Jeffrey,

    Not currently no. The point of the specification pattern really is to limit the search API to only use core supported filters as it could be very easy to build a poor performing query, so we just expose what are good but flexible options.

Please Sign in or register to post replies

Write your reply to:

Draft