Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find-Item : Add support for Filter #1176

Closed
michaellwest opened this issue Mar 5, 2020 · 2 comments
Closed

Find-Item : Add support for Filter #1176

michaellwest opened this issue Mar 5, 2020 · 2 comments
Assignees
Labels
area-commands Involves functions and cmdlets. 🌈 improvement Extra sugar and spice.
Milestone

Comments

@michaellwest
Copy link
Member

If you recall, search engines such as Solr and Azure support both Where and Filter conditions. This request is to add support for Filter.

Would like to be able to filter like the following:

$props = @{
    Index = "sitecore_master_index"
    Where = 'Paths.Contains(@0)'
    WhereValues = [ID]::Parse("{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}")
    Filter = 'Language = @0'
    FilterValues = "en-CA"
}

Find-Item @props

image

@michaellwest
Copy link
Member Author

Here is an example with Predicate. Predicate is now an alias for WherePredicate.

$criteriaLanaguage = @{Filter = "Equals"; Field = "_language"; Value = "en-CA"; }
$predicateLanguage = New-SearchPredicate -Operation And -Criteria $criteriaLanaguage

$criteriaPath = @{Filter = "Contains"; Field = "_path"; Value = [ID]::Parse("{FB05A392-1CC9-437D-A359-B807048060CF}"); Boost=25; }
$predicatePath = New-SearchPredicate -Operation And -Criteria $criteriaPath

$props = @{
    Index = "sitecore_master_index"
    WherePredicate = $predicatePath
    FilterPredicate = $predicateLanguage
}

Find-Item @props

@michaellwest
Copy link
Member Author

Doesn't seem practical to support this for ScopeQuery.

@michaellwest michaellwest pinned this issue Mar 5, 2020
@michaellwest michaellwest self-assigned this Mar 5, 2020
@michaellwest michaellwest added area-commands Involves functions and cmdlets. 🌈 improvement Extra sugar and spice. labels Mar 5, 2020
@michaellwest michaellwest added this to the 6.1 milestone Mar 5, 2020
michaellwest added a commit that referenced this issue Mar 13, 2020
@michaellwest michaellwest unpinned this issue Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commands Involves functions and cmdlets. 🌈 improvement Extra sugar and spice.
Projects
None yet
Development

No branches or pull requests

1 participant