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

115 refactor search and enhance api #116

Merged
merged 18 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/monggregate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from monggregate.dollar import S, SS
from monggregate.pipeline import Pipeline

__all__ = ["Expression", "S", "SS", "Pipeline"]

__version__ = "0.21.0"
__author__ = "Vianney Mixtur"
__contact__ = "[email protected]"
__copyright__ = "Copyright © 2022 Vianney Mixtur"
__copyright__ = "Copyright © 2022-2024 Vianney Mixtur"
__license__ = "MIT"
34 changes: 33 additions & 1 deletion src/monggregate/search/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
"""Search Package"""
"""Search Package"""

from monggregate.search.commons import FuzzyOptions, CountOptions, HighlightOptions, HightlightOutput, CountResults
from monggregate.search.collectors import Facet, Facets, FacetBucket, FacetBuckets, FacetResult, StringFacet, NumericFacet, DateFacet, FacetName
from monggregate.search.operators import Autocomplete, Compound, Equals, Exists, MoreLikeThis, Range, Regex, Text, Wildcard, AnyOperator, OperatorMap
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved

__all__ = [
"FuzzyOptions",
"CountOptions",
"HighlightOptions",
"HightlightOutput",
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
"CountResults",
"Facet",
"Facets",
"FacetBucket",
"FacetBuckets",
"FacetResult",
"StringFacet",
"NumericFacet",
"DateFacet",
"FacetName",
"Autocomplete",
"Compound",
"Equals",
"Exists",
"MoreLikeThis",
"Range",
"Regex",
"Text",
"Wildcard",
"AnyOperator",
"OperatorMap",
]
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions src/monggregate/search/collectors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@
# String
FacetName,
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
)


__all__ = [
"Facet",
"FacetBucket",
"FacetBuckets",
"FacetResult",
"StringFacet",
"NumericFacet",
"DateFacet",
"Facets",
"FacetName",
]
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions src/monggregate/search/commons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
from monggregate.search.commons.count import CountOptions, CountResults
from monggregate.search.commons.fuzzy import FuzzyOptions
from monggregate.search.commons.highlight import HighlightOptions, HightlightOutput

__all__ = ["CountOptions", "CountResults", "FuzzyOptions", "HighlightOptions", "HightlightOutput"]
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/monggregate/stages/search/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
from monggregate.base import pyd, BaseModel
from monggregate.stages.stage import Stage
from monggregate.search.collectors import Facet, Facets
from monggregate.search.collectors import Facet
from monggregate.search.operators import(
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
Autocomplete,
Compound,
Expand Down
22 changes: 2 additions & 20 deletions src/monggregate/stages/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,13 @@

"""

from datetime import datetime
from typing import Any, Callable, Literal
try:
from typing import Self
except ImportError:
from typing_extensions import Self

VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
from monggregate.base import pyd
from monggregate.stages.stage import Stage
from monggregate.stages.search.base import SearchConfig, SearchBase
from monggregate.search.collectors import Facet, Facets
from monggregate.search.operators import(
Autocomplete,
Compound,
Equals,
Exists,
MoreLikeThis,
Range,
Regex,
Text,
Wildcard,
AnyOperator
)
from monggregate.search.operators.compound import ClauseType
from monggregate.search.commons import FuzzyOptions
from monggregate.stages.search.base import SearchBase

VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved


VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
# Classes
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
VianneyMI marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion src/monggregate/stages/search/search_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

"""

from monggregate.stages.search.base import SearchConfig, SearchBase
from monggregate.stages.search.base import SearchBase


class SearchMeta(SearchBase):
Expand Down
Loading