Nextis.SmartSearch.Client: Porovnání verzí
(Není zobrazeno 9 mezilehlých verzí od stejného uživatele.) | |||
Řádka 1: | Řádka 1: | ||
This article describes, how to implement and use '''Nextis.SmartSearch''' technology within the third party products. | This article describes, how to implement and use '''Nextis.SmartSearch''' technology within the third party products. | ||
− | === | + | '''<code>Engine version 9.1.*</code>''' |
+ | |||
+ | === Prerequisites === | ||
==== Referenced libraries ==== | ==== Referenced libraries ==== | ||
Řádka 7: | Řádka 9: | ||
* Nextis.SmartSearch.Client.dll (provided by Nextis) | * Nextis.SmartSearch.Client.dll (provided by Nextis) | ||
* Nextis.SmartSearch.Proxy.dll (provided by Nextis) | * Nextis.SmartSearch.Proxy.dll (provided by Nextis) | ||
+ | |||
+ | ==== Supporting libraries (not referenced) ==== | ||
+ | * Nextis.SmartSearch.Engine.dll (provided by Nextis) | ||
+ | |||
+ | ==== Imports (simplified access) ==== | ||
+ | * Imports Nextis | ||
+ | * Imports Nextis.SmartSearch | ||
+ | * Imports Nextis.SmartSearch.Proxy | ||
==== Framework ==== | ==== Framework ==== | ||
Řádka 32: | Řádka 42: | ||
Me.Client = New Nextis.SmartSearch.Client.SmartSearchClient(Config) | Me.Client = New Nextis.SmartSearch.Client.SmartSearchClient(Config) | ||
End Sub | End Sub | ||
− | </syntaxhighlight>Put your authorization token and address instead of the address in the example. | + | </syntaxhighlight>Put your authorization token and address, received from Nextis, instead of the token and address, mentioned in the example. |
− | INFO: After the initialization of client object, should be the status connected <code>Client.Status =SmartSearchClient.ClientStatuses._initialized</code> | + | INFO: After the initialization of client object, should be the status connected <code>Client.Status = SmartSearchClient.ClientStatuses._initialized</code>. If status differs from "Connected", you need to contact Nextis support to check the problem and figure it out. |
==== Searching through the client ==== | ==== Searching through the client ==== | ||
− | ===== 1.Creating request ===== | + | ===== 1.Creating the request ===== |
<syntaxhighlight lang="vb.net"> | <syntaxhighlight lang="vb.net"> | ||
'Create request | 'Create request | ||
Řádka 52: | Řádka 62: | ||
'.CarSpecificModelYearFrom = 1990 'Allows you to limit the vehicle specific result to vehicles, manufactured since the specified construction year | '.CarSpecificModelYearFrom = 1990 'Allows you to limit the vehicle specific result to vehicles, manufactured since the specified construction year | ||
End With | End With | ||
− | </syntaxhighlight>Put text to recognize into the request and choose the proper language from the enum of supported languages. | + | </syntaxhighlight>Put your text to recognize into the request and choose the proper language from the enum of supported languages. |
− | ===== 3.Sending request ===== | + | ===== 3.Sending the request ===== |
====== Asynchronous ====== | ====== Asynchronous ====== | ||
Řádka 61: | Řádka 71: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* The result is available only within the event SearchFinished | * The result is available only within the event SearchFinished | ||
− | * This | + | * This method is most useful in a WinForms application |
* In case of more threads (search requests) at the same time is always returned the last one and all previous are cancelled | * In case of more threads (search requests) at the same time is always returned the last one and all previous are cancelled | ||
Řádka 68: | Řádka 78: | ||
Dim rp As Nextis.SmartSearch.Proxy.SmartSearchResult = Me.Client.SmartSearch(rq) | Dim rp As Nextis.SmartSearch.Proxy.SmartSearchResult = Me.Client.SmartSearch(rq) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * The result is available within the event SearchFinished and also as a return value of the method | + | * The result is available within the event <code>SearchFinished</code> and also as a return value of the method |
− | * | + | * This method is most useful in a web application to manage multi-threading calls on your own |
− | ===== 4.Getting response ===== | + | ===== 4.Getting the response ===== |
− | For both synchronous and asynchronous calling, you can get the result within the event <code>Client.SearchFinished</code> that is also the preferred option.<syntaxhighlight lang="vb.net"> | + | For both synchronous and asynchronous calling, you can get the result within the event <code>Client.SearchFinished</code> , that is also the preferred option.<syntaxhighlight lang="vb.net"> |
Private Sub Client_SearchFinished(Data As SmartSearchResult) Handles Client.SearchFinished | Private Sub Client_SearchFinished(Data As SmartSearchResult) Handles Client.SearchFinished | ||
Dim Info As String = "" | Dim Info As String = "" | ||
Řádka 80: | Řádka 90: | ||
Next | Next | ||
− | 'Vehicle specific data ( | + | 'Vehicle specific data (filed when engine decides that user is looking for specific vehicle) |
If Data.ResultPercentage(Definitions.SearchTargetTypes.Car) > 50.0 Then | If Data.ResultPercentage(Definitions.SearchTargetTypes.Car) > 50.0 Then | ||
If Not Data.VehicleSpecificData Is Nothing Then | If Not Data.VehicleSpecificData Is Nothing Then | ||
Řádka 131: | Řádka 141: | ||
Me.TextBox2.Text = Info | Me.TextBox2.Text = Info | ||
End Sub | End Sub | ||
− | </syntaxhighlight>The example above shows, ho to handle the result of the SmartSearch.Client. The variable Data as SmartSearchResult contains all possible information about the pattern recognition, vehicle specific data including EngineID's, GenericArticleID's and so on. | + | </syntaxhighlight>The example above shows, ho to handle the result of the SmartSearch.Client. The variable <code>Data as SmartSearchResult</code> contains all possible information about the pattern recognition, vehicle specific data including EngineID's, GenericArticleID's if applicable and so on. |
+ | |||
+ | ====== Evaluate the result ====== | ||
+ | Each target type is, in the result data, represented with the percentage value of the probability, that user expects search in such a target. Percentile over 50% means high probability, percentile over 75% means almost sureness. In some moments, the percentile of some sources could reach a negative value. However, the total percentile of all targets should be always equal to 100. | ||
+ | |||
+ | ==== Feedback from users ==== | ||
+ | Methods to provide feedback, based on user choices. Implementation of this function uses machine learning to constantly improve the search and recognition results. | ||
+ | |||
+ | Currently available only for internal purposes. Public release of the feedback method is planned to 3.Q.2019 | ||
+ | |||
+ | ==== Work with synonyms ==== | ||
+ | Currently available only for internal purposes and new synonyms could be imported only through the Nextis support. | ||
+ | |||
+ | Public release of the feedback method is planned to 4.Q.2019 | ||
==== Obtaining the service state ==== | ==== Obtaining the service state ==== | ||
− | + | Functionality, that provides general information about the Nextis.SmartSearch service, you are connected to.<syntaxhighlight lang="vb.net"> | |
Dim ServiceInfoResponse = Me.Client.ServiceInfo | Dim ServiceInfoResponse = Me.Client.ServiceInfo | ||
With ServiceInfoResponse | With ServiceInfoResponse | ||
Řádka 145: | Řádka 168: | ||
End With | End With | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | ==== Development plan 2019/2020 ==== | ||
+ | # Fitting position and other primary parameters recognition | ||
+ | # Product brands recognition | ||
+ | # Fine tuning at a customer side | ||
+ | # Personalized results, based on user common behaviour | ||
+ | # Personalization of data sources (own synonyms etc.) | ||
+ | # Providing search and feedback statistics |
Aktuální verze z 5. 7. 2019, 12:23
This article describes, how to implement and use Nextis.SmartSearch technology within the third party products.
Engine version 9.1.*
Obsah
Prerequisites
Referenced libraries
- Core.UI.Culture.dll (provided by Nextis)
- Nextis.SmartSearch.Client.dll (provided by Nextis)
- Nextis.SmartSearch.Proxy.dll (provided by Nextis)
Supporting libraries (not referenced)
- Nextis.SmartSearch.Engine.dll (provided by Nextis)
Imports (simplified access)
- Imports Nextis
- Imports Nextis.SmartSearch
- Imports Nextis.SmartSearch.Proxy
Framework
- .NET Framework ver.: 4.6.1 and higher
Connection information
- Authorization token (provided by Nextis)
- Service location/address (provided by Nextis)
Implementation
Declaration of the client object
Private WithEvents Client As Nextis.SmartSearch.Client.SmartSearchClient
Initialization of the client object
Sub Initialize()
Dim Config As New Nextis.SmartSearch.Client.SmartSearchClientConfiguration()
With Config
.Mode = Nextis.SmartSearch.Client.SmartSearchClient.ClientMode.RemoteWS
.WSAddress = "smartsearch.nextis.cz:port"
.AuthorizationToken = "token"
End With
Me.Client = New Nextis.SmartSearch.Client.SmartSearchClient(Config)
End Sub
INFO: After the initialization of client object, should be the status connected Client.Status = SmartSearchClient.ClientStatuses._initialized
. If status differs from "Connected", you need to contact Nextis support to check the problem and figure it out.
Searching through the client
1.Creating the request
'Create request
Dim rq As New Nextis.SmartSearch.Proxy.SmartSearchRequest('Text to recognize', Core.UI.Culture.Languages.de)
'Enable/disable recognition options
With rq
.AllowCar = True
.AllowCode = True
.AllowKBA = False 'Not implemented yet
.AllowText = True
.AllowVIN = True
'.CarSpecificModelYearFrom = 1990 'Allows you to limit the vehicle specific result to vehicles, manufactured since the specified construction year
End With
3.Sending the request
Asynchronous
Me.Client.SmartSearchAsync(rq)
- The result is available only within the event SearchFinished
- This method is most useful in a WinForms application
- In case of more threads (search requests) at the same time is always returned the last one and all previous are cancelled
Synchronous
Dim rp As Nextis.SmartSearch.Proxy.SmartSearchResult = Me.Client.SmartSearch(rq)
- The result is available within the event
SearchFinished
and also as a return value of the method - This method is most useful in a web application to manage multi-threading calls on your own
4.Getting the response
For both synchronous and asynchronous calling, you can get the result within the eventClient.SearchFinished
, that is also the preferred option.Private Sub Client_SearchFinished(Data As SmartSearchResult) Handles Client.SearchFinished
Dim Info As String = ""
If Data.ResultState = Nextis.SmartSearch.Proxy.Definitions.ResponseStatus.Ok Then
For Each SearchType As Nextis.SmartSearch.Proxy.Definitions.SearchTargetTypes In Data.ResultPercentage.Keys
Info &= SearchType.ToString & ": " & Data.ResultPercentage(SearchType) & "%" & vbCrLf
Next
'Vehicle specific data (filed when engine decides that user is looking for specific vehicle)
If Data.ResultPercentage(Definitions.SearchTargetTypes.Car) > 50.0 Then
If Not Data.VehicleSpecificData Is Nothing Then
For Each cr As SmartSearch.Proxy.VehicleSpecific.VehicleSearchResult In Data.VehicleSpecificData.Models
'Case when result contain only vehicle specific data (does not contain any generic articles)
If Data.VehicleSpecificData.Articles.Count = 0 Then
Dim vInfo As String = cr.ManuID & "_" & cr.ModelID & "_" & cr.EngineID & "_" & -1 & ", "
vInfo &= cr.ManuName + " " + cr.ModelName & ", "
If cr.EngineID > 0 Then
vInfo &= cr.EngineName & ", "
vInfo &= cr.EnginePowerHP & ", "
vInfo &= cr.EnginePowerKW & ", "
vInfo &= cr.EngineConstFrom & " - " & IIf(Val(cr.EngineConstTo) > 2500, " > ", cr.EngineConstTo) & ", "
Else
vInfo &= "-" & ", "
vInfo &= "-" & ", "
End If
vInfo &= "-"
vInfo &= "Ranking:" & Format(cr.RankCar * 1000, "#00000") & "_" & cr.ModelName & "_" & cr.EngineName & ", "
Info &= Chr(10) & vInfo
Else
'Case when result contains vehicle specific data and also generic articles
For Each Article As SmartSearch.Proxy.VehicleSpecific.VehicleConstructionGroup In Data.VehicleSpecificData.Articles
If cr.SupportedArticlesIDs.Contains(Article.ID) = True Then
Dim vInfo As String = cr.ManuID & "_" & cr.ModelID & "_" & cr.EngineID & "_" & Article.ID & ", "
vInfo &= cr.ManuName + " " + cr.ModelName & ", "
If cr.EngineID > 0 Then
vInfo &= cr.EngineName & ", "
vInfo &= cr.EnginePowerHP & ", "
vInfo &= cr.EnginePowerKW & ", "
vInfo &= cr.EngineConstFrom & " - " & IIf(Val(cr.EngineConstTo) > 2500, " > ", cr.EngineConstTo) & ", "
Else
vInfo &= "-" & ", "
vInfo &= "-" & ", "
End If
vInfo &= Article.Phrase & " " & " (ID " & Article.ID & ")" & ","
vInfo &= "Ranking:" & Format(cr.RankCar * 1000, "#00000") & "_" & cr.ModelName & "_" & cr.EngineName & "_" & Format(Article.Match, "#00000.0000")
Info &= Chr(10) & vInfo
End If
Next
End If
Next
End If
End If
Else
Info = Data.ResultState.ToString
End If
Me.TextBox2.Text = Info
End Sub
Data as SmartSearchResult
contains all possible information about the pattern recognition, vehicle specific data including EngineID's, GenericArticleID's if applicable and so on.
Evaluate the result
Each target type is, in the result data, represented with the percentage value of the probability, that user expects search in such a target. Percentile over 50% means high probability, percentile over 75% means almost sureness. In some moments, the percentile of some sources could reach a negative value. However, the total percentile of all targets should be always equal to 100.
Feedback from users
Methods to provide feedback, based on user choices. Implementation of this function uses machine learning to constantly improve the search and recognition results.
Currently available only for internal purposes. Public release of the feedback method is planned to 3.Q.2019
Work with synonyms
Currently available only for internal purposes and new synonyms could be imported only through the Nextis support.
Public release of the feedback method is planned to 4.Q.2019
Obtaining the service state
Functionality, that provides general information about the Nextis.SmartSearch service, you are connected to.Dim ServiceInfoResponse = Me.Client.ServiceInfo
With ServiceInfoResponse
'.ActiveLanguages (list of currently supported languages)
'.ArticleCount (count of all available generic articles)
'.CarModelCount (count of all available vehicle models)
'.RelationCount (count of relations between vehicles and generic articles)
'.ResultState (general information that request has been processed properly)
'.Loaded (true if service is properly loaded into the memory)
End With
Development plan 2019/2020
- Fitting position and other primary parameters recognition
- Product brands recognition
- Fine tuning at a customer side
- Personalized results, based on user common behaviour
- Personalization of data sources (own synonyms etc.)
- Providing search and feedback statistics