Integrating and Customizing Keyoti Search within Advantage CSP Advantage CSP seamlessly incorporates Keyoti Search as its default search solution, enabling a powerful search feature right out of the box. However, if your project demands a different search capability, Advantage CSP is flexible enough to accommodate alternative search appliances, including popular options like Elastic, Lucene, Azure Search, and Google Search. Setting Up Keyoti Search Initial Configuration When launching a new website, it's crucial to initiate the search indexing process. Keyoti Search automates this by crawling and indexing the primary URL defined in your webmaster's domain tool. This ensures that your site's content is searchable right from the start. Web.config Adjustments To configure Keyoti Search, modify your web.config file with the following settings: License Key: Include your unique Keyoti Search Engine license key to activate the search functionality. Key<add key="Keyoti-SearchEngine-LicenseKey" value="YOUR_LICENSE_KEY_HERE"/> Meta Keyword Weight: Adjust the importance of meta keywords in search rankings. Meta<add key="Keyoti-MetaKeyWordWeight" value="15"/> Meta Description Weight: Set the significance of meta descriptions for search relevance. Customizing Keyoti Search Appearance Pagination Styling Challenges A known limitation with Keyoti's pagination is its output format, which presents a string of page links. This default presentation doesn't separately highlight the currently selected page, making direct CSS styling of the active page indicator challenging. Styling Solution To introduce styling capabilities, especially for the current page in pagination, you can manipulate the pagination string on the front end. By passing Container.PageLinksBlock to a custom formatting method, you can inject HTML tags around the page numbers, enabling individual styling. Example Implementation Consider the following markup structure to apply your custom pagination styling: Pagination Styles<ul class="pagination-adv"> <li class="hide"><%# Container.PreviousPageLink %></li> <li class="search"><%# FormatPaging(Container.PageLinksBlock) %></li> <li class="hide"><%# Container.NextPageLink %></li> </ul> Use the following method to format the page links, employing a Regex pattern to identify and wrap numbers (representing page links) in a span tag for easier styling: {638477365300504519} Styling the Pagination After wrapping the page numbers in span tags, apply your desired CSS styling. For instance, to make the pagination numbers stand out, you might choose a vibrant color like lime for the spans within the .pagination-adv list: Page Numbers.pagination-adv li.search span { color: lime; } This approach not only enhances the functionality of Keyoti Search within Advantage CSP but also ensures a seamless and visually appealing user experience. Implementing Geospatial Search with Advantage CSP Advantage CSP now supports the integration of geospatial search capabilities, enhancing the user experience for applications requiring location-based searches. This functionality is perfect for a variety of applications, including store locators, classified ads, and vacation rental listings. In this guide, we'll demonstrate how to incorporate geospatial search into a simple job listing website, showcasing only those positions within a specified radius of the user's location. This tutorial will provide a foundational understanding of implementing geospatial search features with SearchUnit. Initial Configuration For demonstration purposes, we've prepared a basic ASP.NET web application and integrated SearchUnit. To facilitate indexing, we've created simple HTML pages representing various job listings, each linked together to assist the crawler in indexing the content efficiently. Incorporating Geolocation Data To enable geospatial searches for job listings, it's essential to embed latitude and longitude information within the job pages. This can be achieved by adding a specific meta tag for Custom Data on each page: Geo Data Includer<meta name="Keyoti_Search_Custom_Data" content="geolocation=XX.XXX, XX.XXX" /> Following the inclusion of geolocation data, the next step involves creating the index. For simplicity, our HTML job pages are stored within the application, allowing for straightforward indexing through a web import using the Index Manager tool once the webserver is operational. Implementing the Geolocation Filter To add a geolocation filter to your search page, insert the following HTML. This filter provides users with a dropdown menu to select the search radius: Geolocation Filter<div class="sew_filterControl"> <!-- Configuration for the geolocation filter, offering radius options from "Any" to "100 miles" --> </div> Integrating a Geocoding Service For users to enter locations in free text, integrate a geocoding service such as Google's Places API with the following script, allowing for dynamic location-based searches: Geocoding service such as Google's Places API<script type="text/javascript"> // Script to integrate Google Places API for autocomplete location search </script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_API_KEY&libraries=places"></script> Replace "YOUR_GOOGLE_API_KEY" with your own to ensure functionality outside of localhost environments. Finalizing the Setup Add the search box control to facilitate user queries and the search result control to display the findings, complete with sorting and geospatial filtering options: Search Box<div id="sew_searchBoxControl"></div> <div id="sew_searchResultControl"> <div id="sew_sortControl" style="display: inline-block"> <!-- Configuration for sorting the search results by distance --> </div> </div> Finally, specify the index directory path for your job site index, enabling SearchUnit to access and query your geospatial data effectively: Index DirectorykeyotiSearch.indexDirectory = "pathToYourIndexDirectory"; With these steps, Advantage CSP users can now leverage the power of geospatial search to enhance their web applications, offering location-based search functionalities. For more advanced customizations, such as adding mapping features, please refer to the demo projects provided with SearchUnit or reach out for further assistance. Advantage CSP: Programmatic Index Management with SearchUnit Advantage CSP: Programmatic Index Management with SearchUnit Advantage CSP includes SearchUnit, offering a comprehensive index management tool for handling various aspects of the index, including document importation from diverse sources. While the graphical Index Management tool is intuitive for most tasks, there are instances when direct programmatic interaction with the index is preferable. This might include incremental addition or removal of documents, among other operations. Programmatically Importing Sources Importing a source—whether a website, file system folder, database, or DataSet—entails scanning for and indexing all eligible documents based on specified criteria. Programmatic reimportation triggers a rescan of the source to capture updates or, if necessary, reindexes everything. C# Example for Various Imports: Website Import: Website ImportDocumentIndex documentIndex = new DocumentIndex(configuration); documentIndex.ImportWebsite(startURL); // Alternatively: documentIndex.Import(new WebsiteBasedIndexableSourceRecord(startURL, pathsToIgnore, pathsToInclude)); File System Folder Import: File System Folder ImportdocumentIndex.ImportFileSystemFolder(localFolderPath, virtualPath, targetMatchList, ignoreMatchList, recurseSubFolders); Database Import: Database ImportdocumentIndex.ImportDatabase(sourceType, connectionString, sqlQuery, uniqueColumnName, resultUrlFormat); Custom DataSet Import (from an assembly: Custom DataSet Import (from an assemblydocumentIndex.ImportCustomDataSet(assemblyFilePath, fullClassName, uniqueColumnName, resultUrlFormat); Always close the documentIndex after operations to ensure proper resource management. Adding Individual Documents For incremental updates to the index as new documents become available, you can add documents one at a time. Note: The completion time for Add Document varies. It's recommended not to use this method in web applications where immediate page response is required. Asynchronous Document Addition To avoid delays in web applications, documents can be queued for background indexing using the AsynchronousQueue class. C# Example for Asynchronous Addition: Example for Adding a Document:DocumentIndexdocumentIndex=newDocumentIndex(configuration);documentIndex.RemoveDocument(new Document(uriToMatchExactly, Configuration)); documentIndex.AddDocument(new Document("http://some/URL/document", configuration)); } finally { documentIndex.Close(); } For database-originated documents, recreate the URI based on the IndexableSource ID and unique field. Adding Data as Strings For scenarios where data doesn't reside in traditional documents—like indexing extra descriptions or database content—use the PreloadedDocument class. C# Example for PreloadedDocument: PreloadedDocumentdocumentIndex.AddDocument(new PreloadedDocument(uri, title, text, summary, null, null, null, customData, configuration)); To remove a PreloadedDocument, use the RemoveDocument method with the same URI used during creation. By leveraging these programmatic capabilities, users of Advantage CSP can enhance their SearchUnit index management, tailoring it to their specific requirements for efficient and dynamic content indexing and updating. Integrating SearchUnit Search Services in Mobile Applications This guide details how to harness SearchUnit search web services for mobile platforms including Android, iOS, and Windows. Particularly, we focus on setting up an Android search interface, noting that the process remains largely similar across other platforms. Prerequisites SearchUnit Deployment: Your server must have a web application running with SearchUnit deployed and a searchable index available. Downloadable Project: An Android project and an MVC server-side project are provided. The MVC project, while basic, contains the SearchService.svc in the Keyoti_SearchEngine_Web_Common folder, managing incoming calls from the mobile client. Important Setup Notes SearchUnit DLLs: The MVC project needs the SearchUnit DLLs. Install these via MSI, manually into the GAC, or by copying them to the project's BIN and referencing them there. IIS Hosting: The MVC project requires IIS for hosting since only IIS can serve remote machines. IIS Express and the developer webserver do not support remote access. Administrator Privileges: Open the MVC project with administrator privileges due to IIS hosting requirements. License Key: Ensure you have a valid license key for the search engine. A temporary key in the web.config may need replacement if expired. Android Project Setup: The Android project (Android Studio) should have the server address configured to point to the machine running the SearchUnit6-ServiceExample web application. Adjust the serverAddress field in SearchActivity.java accordingly. Remember, localhost addresses won't work with Android emulators as they run on separate (virtual) machines. Operation Overview This setup uses JSON for packaging request data and interpreting the JSON response from the SearchUnit service. The primary task involves creating an interface to the search service, initiating service requests, and handling responses. Code Snippet: Android AsyncTask for Search An AsyncTask class named SearchTask encapsulates the process from sending the search query to displaying the results. The task constructs a JSON object for the request, posts it to the search service, and processes the JSON response. Code Snippet: Android AsyncTask for Searchclass SearchTask extends AsyncTask<String, Void, JSONObject> { String serverAddress = "http://192.168.1.103"; // Server address String appRoot = "/SearchUnit6-ServiceExample"; // Application root // doInBackground method to send request and handle response protected JSONObject doInBackground(String... query) { // Construct request and handle response } // onPostExecute method to unpack and display results protected void onPostExecute(JSONObject response) { // Extract and display results } } This simplified overview abstracts details like request construction and response parsing, focusing on the asynchronous task's structure. The task: Constructs a service request URL and parameters as a JSON string. Sends the request using HttpPost. Logs the response and converts it to a JSON object for processing. Extracts search results from the response and populates them into a list for display. Integration Steps Configure the Server Address: Ensure the Android project's serverAddress points to your server. Handle Search Requests: Implement doInBackground to construct and send search requests. Process Search Responses: In onPostExecute, parse the JSON response, extracting search results for display. By following these steps and considering the important setup notes, developers can effectively integrate SearchUnit's search capabilities into their mobile applications, enhancing the user experience with powerful server-side search functionalities. Related Guides: Building-PWAs-and-native-mobile-applications Configuring-Advantage-CSPs-search-and-indexing-features Web API