#Solr Query Filters
Explore tagged Tumblr posts
Text
#Solr Query Syntax#Apache Solr Query Language#Solr Search Query Examples#Solr Query Parameters#Solr Query Filters#Solr Advanced Query Syntax#solr query#solr in query#Master Solr Query Syntax
0 notes
Text
Can NextBrick help with e-commerce search using Solr?
Absolutely, NextBrick specializes in providing e-commerce search solutions using Solr. We understand that e-commerce businesses rely heavily on the effectiveness of their search functionality to drive sales and enhance the overall shopping experience. Our Solr Consulting and Implementation services are tailored to meet the unique needs and challenges of e-commerce platforms.
Here's how NextBrick can help with e-commerce search using Solr:
Enhanced Product Search: We optimize product search capabilities to ensure that customers can easily find the products they're looking for. This includes implementing features like faceted search, auto-suggest, and typo-tolerance to improve the search experience.
Personalization: We leverage Solr's powerful features to enable personalized search results. This means showing customers products and content that are most relevant to their preferences and past interactions, increasing the likelihood of conversion.
Improved Navigation: We enhance navigation through intuitive filters and sorting options, enabling customers to refine their search results based on criteria such as price, brand, size, and more.
Scalability: E-commerce platforms often deal with a large volume of products and user traffic. Our Solr solutions are designed for scalability, ensuring that your search capabilities can handle growth without performance bottlenecks.
Multi-language and Multilingual Support: If your e-commerce business operates in multiple regions or serves customers speaking different languages, we can configure Solr to support multi-language and multilingual search.
Integration with E-commerce Platforms: NextBrick can seamlessly integrate Solr with your existing e-commerce platform, such as Magento, WooCommerce, or Shopify, to ensure smooth operation and data synchronization.
Data Quality and Relevance: We implement data quality checks and relevance tuning to ensure that product listings are accurate, up-to-date, and displayed in order of relevance to the customer's query.
Analytics and Insights: Our Solr solutions provide valuable insights into customer behavior and search patterns, enabling you to make data-driven decisions and refine your e-commerce strategies.
Mobile Optimization: With the growing trend of mobile shopping, we optimize Solr search for mobile devices to deliver a seamless and responsive experience for mobile shoppers.
Whether you're launching a new e-commerce platform or looking to enhance the search capabilities of your existing one, NextBrick's Solr Consulting and Implementation services can help you create a powerful and effective e-commerce search solution that drives sales and enhances customer satisfaction.
0 notes
Text
Every Developer Should Know About These 15 Ruby on Rails Gems
If you are looking forward to creating a web application with robust features Ruby on Rails is the best framework to work with. Ruby on Rails framework can be further extended with Ruby gems. Gems allow developers to finish the web development process within days rather than months. They can be easily integrated and every Ruby on Rails development services tends to use these gems to create powerful web apps that are rich in functionalities.
There are a large number of Gems created by the RoR community, but we enlist the top 15 Gems that are regularly used by the Ruby on Rails web development company.
#1. The Active Record-Import
With ActiveRecord-Import, developers can insert the bulk of records in one go, they don’t have to deal with the N+1 insert problem. Thus, importing external data becomes possible as the conversion time is reduced.
#2. Draper
To build decorators around the model, developers use Draper gem. With Draper, the view can be made cleaner, developers can simply define a decorator without having to write helpers. Drapers offer attributes and extend methods for the object.
#3. Pry
Library integration can be an issue and even binding of the gems while writing the codes. This invites a lot of error, and in order to eliminate these issues or debug these errors, PRY gem can be really useful. Developers establish breakpoints and start code debugging. PRY offers exclusive features including runtime invocation, Syntax highlighting, exotic object support, flexible and powerful command system, and command shell integration. PRY is the active feature in ruby on rails development services.
#4. RSpec Rails
Developers choose RSpec Rails when they have to write unit test cases, it facilitates the developers with the integration of RSpec framework into any Rails project. It is used in TDD and BDD environments, it also features descriptive and neat syntax.
#5. Figaro
Figaro is used for secure configuration of the applications, it keeps the configuration data and SCM separate and passes the YAML file and loads the value in the ENV.
#6. Devise
While creating an application or an eCommerce solution, developers need to create authorization or authentication to access the same, in simpler words creating a login process for the users. Some developers prefer using their own codes to create the login system while others prefer using Devise gem for authentication which of course is an easier and faster process to do so. Devise has 11 different models which are Database_Authenticatable, Authenticatable, Lockable, Confirmable, Omniauthable, Recoverable, Rememberable, Registrable, Trackable, Timeoutable, Validatable respectively.
#7. Ahoy
It is an analytics platform, used to track the events and the visit in the native apps like JavaScript and Ruby. Ahoy is more of a Ruby engine rather than a gem, responsible for creating visit tickets that consists of the traffic source, client device information, and the location. Users can also check the UTM parameters of the website visits.
#8. Paperclips
Working with file attachments can be a hefty task, it takes a lot of time and effort of the developers to ensure secure implementation of the task. This is where Paperclip saves the day; it keeps track of the whole process in the Rails app. It can also convert images to thumbnails.
#9. Delayed Job
The Delayed Job can handle the longer running actions for the background tasks. Features of Delayed Job include sending a large number of newsletters, Image resizing, spam checks, updating smart collections, batch imports, HTTP downloads, and updating solr.
#10. Kaminari
Paginate anything through Kaminari. This is one of the most popular gems among the developers. It already has 5 million downloads under its kitty. The developers of Ruby on rails web development company are sure to use this gem.
#11. CanCanCan
It is used to build complex applications, developers can easily set up the restrictions to users’ access. The authorizations definition library module lets developers set the rules to restrict access to certain users.
#12. Active Admin
This framework builds the interfaces of administration style. Active Admin extracts the business application patterns and makes it easy for engineers to implement rich and wonderful interfaces with less exertion. Its different features incorporate User Authentication, Scopes, Action Items, Global Navigation, Sidebar Sections, Filters, Index Styles, Downloads, and APIS.
#13. Active Merchant
This gem facilitates the users with a unified API to provide access to various payment gateways. This gem can also be incorporated as a plug-in. It is majorly used for RoR web applications and also used majorly by any web application development company.
#14. Bullet
It reduces the queries and increases the performance of the application. It notifies the users when the (N+1) queries are required and when the counter cache should be used.
#15. Webpacker
It supports JavaScript, CSS, fonts, and images relevant to component-based JavaScript. It works wonders for Rails app development.
Conclusion
Using Ruby gems is standard practice for the providers of Ruby on Rails web development services. These gems can easily resolve the issues pertaining to uploads, file testing, authorization, and authentication. But it’s better to hire a professional agency who has the right knowledge to build & offer RoR custom web application development services. W3villa Technologies has experience with the technology and the gems. The developers here can build the latest applications to suit your business process.
1 note
·
View note
Text
How Solr Uses Advanced Search to Strengthen Organizations?
Solr’s advanced search technology allows for better precision and customization, leading to stronger and more efficient organizations.
We often sense information overload in the digital era, therefore organizations are continuously looking for solutions to efficiently search for and recover essential data. This is where the Solr search engine, which is based on Apache Lucene, comes in, with powerful search tools that have the ability to boost organizations in a variety of ways.
Organizations can boost client satisfaction and engagement by enhancing the importance of their search results with Solr’s advanced search features. Users may discover the information they need quickly and precisely because of Solr’s interactive search, smart search, and spell-checking capabilities. This improves not only the user experience but also the organization’s fruitfulness and productiveness.
Solr can manage massive amounts of data and allow distributed searching and indexing while providing a lightning-fast search experience.
The combination of Solr and machine learning techniques and recommendation algorithms enable personalized search outcomes. Organizations can utilize Solr’s advanced search features to give personalized search results, proposals, and suggestions by analyzing user behavior and interests. This level of personalization boosts user participation, sales, and client retention.
How does Solr manage queries?
Solr transforms the needed data into a structured representation as part of the indexing process. This entails parsing the data, extracting essential information, and categorizing it. If you’re indexing a group of documents, Solr can pull the title, author, content, and other metadata from each document and store it in distinct fields. Solr supports a variety of data formats, including XML, JSON, CSV, and others.
How Solr’s Advanced Search Can Benefit Your Business
Apache Solr Consulting Services can provide additional benefits to businesses leveraging Solr’s advanced search capabilities. Businesses can benefit from Solr’s sophisticated search capabilities in a variety of ways, including the ability to provide strong and efficient search experiences for their users. Here are some examples of how Solr’s advanced search functions might help your business:
Algorithms for ranking relevance: Solr has a number of relevance ranking algorithms that may be modified and fine-tuned to meet your unique business requirements. To assess the relevancy of search results, you can apply varying weights to various factors such as keyword matching, field enhancements, and proximity. You may ensure that the most relevant and significant results appear at the top of the search results list by customizing these algorithms.
Filtering and boosting: Solr allows you to boost or promote select documents or fields depending on specific criteria. Greater relevance scores can be assigned to specific attributes, such as product names, titles, or customer ratings, to guarantee they have a bigger effect on the overall ranking of search results. You can also use filters to narrow down search results based on specific criteria, enhancing relevancy and accuracy even further.
Sorting and relevance evaluation: Solr allows you to arrange search results based on criteria such as relevancy, date, or any other field value. You can set the sorting order to guarantee that the most relevant or recent results appear at the top of the search results list. Solr computes relevance scores based on parameters such as keyword frequency, field boosts, and other relevance ranking methods, allowing you to fine-tune search result ranking.
Better user experience: Faceted search allows users to explore and refine search results in a natural and dynamic manner. Users can rapidly drill down into certain features and locate the most relevant information by showing relevant facets or categories connected to the search results. This improves the overall user experience by streamlining the search process and shortening the time it takes to find desired results.
Facet counts that change dynamically: Solr can dynamically generate facet counts, displaying the number of matching documents for each facet value in real-time. This guarantees that the facet values appropriately represent the possibilities that are currently accessible depending on the search results. Users may see how many results are connected with each aspect value, allowing them to make more educated filtering decisions.
Conclusion
The capacity to process vast amounts of data and give real-time search updates guarantees that organizations can keep up with ever-changing data landscapes and present users with up-to-date information.
Furthermore, Solr’s connection with external systems and support for multilingual search enables organisations to search and index data from multiple sources smoothly, eliminating language barriers and offering a uniform search experience across disparate datasets.
The advanced search features of Solr serve as a foundation for organisations, allowing them to strengthen their operations, drive innovation, and gain meaningful insights from their data, eventually leading to better efficiency and success in today’s data-driven world.
Originally published by: How Solr Uses Advanced Search to Strengthen Organizations?
#Apache Solr Consulting Services#Apache Solr Development#Machine Learning Development#Advanced Strength of Solr#Solr search features
1 note
·
View note
Text
Logstash listening to filebeats for different log type

LOGSTASH LISTENING TO FILEBEATS FOR DIFFERENT LOG TYPE CODE
For example we are creating a file calledĬonfigure logstash input to listen to filebeat on port 5044īy default, redisearch is listening on port 6379
Configure the logstash pipeline by creating a file.
# setup filebeat to send output to logstash – Enable filebeat input to read logs from the specified path and change the output from Elasticsearch to logstash.
Configure file: /etc/filebeat/filebeat.yml.
RediSearch has an output plugin to store all incoming logs from the input plugin.
Filebeat has an input plugin to collect logs from various sources.
Logstash plugins we use in the example are:.
Let’s see some examples of the usage and configuration of RediSearch in the logstash pipeline. This logstash output plugin helps receive log messages coming from logstash and stashes them into RediSearch. In order to store logs into RediSearch, a builtin plugin Logstash output plugin for RediSearch was created.
The output stage initiates the process to send data to a particular destination.
The filter stage is mandatory in order to perform intermediary processing on data.
Input is the stage that helps get data into logstash.
Logstash data processing pipeline has three stages namely Input, Filter, and Output. RediSearch is powerful yet simple to manage and maintain and is efficient enough to serve as a standalone database or augment existing Redis databases with advanced, powerful indexing capabilities.
LOGSTASH LISTENING TO FILEBEATS FOR DIFFERENT LOG TYPE CODE
It is possible because of Redis’ robust in-memory architecture based on modern data structures and optimal code execution written in “C” language, whereas Elasticsearch is based on the Lucene engine and is written in Java programming language. RediSearch is faster in performance compared to any other search engine like Elasticsearch or Solr. RediSearch is also a full-text search and aggregation engine, built as a module on top of Redis. Elasticsearch is a distributed full-text search engine that possesses the capability to highly refine analytics capabilities. Elasticsearch is often used as a data store for logs processed with Logstash. Logstash is a data processing pipeline that allows you to collect data from different sources, parse on its way, and deliver it to your most likely destination for future use. Logstash is the most powerful tool from the elastic stack which is used for log management. This can be easily achieved by using an elastic stack. To make it faster, centralized logging is said to very helpful, and gives us the opportunity to aggregate logs from various applications to a central place and perform search queries against logs. It becomes tedious to manage all the logs as the number of applications increases. Rename => Ĭonfigure your data source integration to have different log types.Logs have been an essential part of troubleshooting application and infrastructure performance ever since its existence. For example, you could create the mylog.type field and then transform that field to iis.logs. You can also query your log fields to check the log type if you have created the field in your log. Using log fields to distinguish log types For example, we may want to change the index name the logs appear under in Elasticsearch and Kibana. You can use Logstash to query log types in your Logstash filter and then perform actions based upon that condition. You can access your Logstash filters from the dashboard for any of your Logit Stacks by choosing View Stack Settings > Logstash Pipelines. To further differentiate between the log types, we need to make use of the Logstash Filter. Using Logstash to further differentiate between log types From here we can then use Logstash to further differentiate between these log types. In order to tell the difference between the logs that are coming from these folders, we have added logType1 to one set of logs and logType2 to the other set of logs. In the above example we have two folders that contain logs. If you are using an Elastic Beat source such as Auditbeat, Filebeat or Metricbeat you can have multiple inputs sections in your configuration file to distinguish between different types of logs by editing the Beat configuration file and setting the type to be named differently.įor the example, below we are editing the Filebeat configuration file to separate our logs into different types. How do I separate my logs into different log types?ĭifferentiating between different log types in Logstash can be achieved in various ways. If you are collecting two sets of logs using the same Elastic beat source you may want to separate them so that you can perform certain actions on them if they meet certain conditions.įor example, you may want to change the index name of one log type to help make it more identifiable. Why would I want to differentiate between different log types?

0 notes
Text
Solr Indexing/Searching Hindi documents
Solr support many languages where user can indexing/searching their documents.In this article we will discuss how indexing/searching done in one of the most popular language in india which is also nation’s national language.
Solr provide three filters to handle hindi language very well.These are as below:
IndicNormalizationFilterFactory
HindiNormalizationFilterFactory
HindiStemFilterFactory
Let’s look now how we can configure above filterfactories and use them.
Table of Contents [hide]
Step 1: Create FieldTyeStep 2: Field Configuration
Step 3: Add documents
Step 4: Search documents
Was this post helpful?
Step 1: Create FieldTye
Create custom fieldType and add above FilterFactory as below.
<fieldType name="text_hindi" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.SynonymFilterFactory" synonyms="hindi/synonyms.txt" ignoreCase="true" expand="true"/> <!-- Case insensitive stop word removal. add enablePositionIncrements=true in both the index and query analyzers to leave a 'gap' for more accurate phrase queries. --> <filter class="solr.StopFilterFactory" words="hindi/stopwords.txt" ignoreCase="true" enablePositionIncrements="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.HindiStemFilterFactory" protected="hindi/protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> <filter class="solr.IndicNormalizationFilterFactory"/> <filter class="solr.HindiNormalizationFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.StopFilterFactory" words="hindi/stopwords.txt" ignoreCase="true" enablePositionIncrements="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.HindiStemFilterFactory" protected="hindi/protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> <filter class="solr.IndicNormalizationFilterFactory"/> <filter class="solr.HindiNormalizationFilterFactory"/> </analyzer> </fieldType>
Step 2: Field Configuration
Now use above created field type in field defination.
<field name="FULL_TEXT" type="text_hindi" indexed="true" stored="true"/>
Step 3: Add documents
Add documents which has hindi content like “जावा डेवलपर ज़ोन बहुत अच्छे ब्लॉग लिखते हैं”. here we are using solr upload document command solr gui dashboard.

Step 4: Search documents
That’s it.To test whether particular document is indexed or not.Fire query like FULL_TEXT:”जावा डेवलपर”.Solr will return one document as below.

0 notes
Link
We live in a highly virtual world where the governing or binding force that combines our needs or requirement is just a step away. Is it buying your favourite pair of latest Jordan or booking the Friday’s first show of Matinee or even staying updated with the UEFA point’s table, everything is around the corner?
Probably there isn’t any variable left in the entire cosmos that hasn’t been connected or whose information is pretty difficult to extract. Everything, anything is just a click away, all we got to do is to SEARCH.
Now, probably the question arises, how’s that possible to navigate through Millions of pages and extract exactly what we were looking for and that too be in fraction of seconds?
The Answer: Wp Search Plugin
So, folks if you are interested in knowing what and how things happen when someone searches off a query than stay on, also we’ll be proving you Top 5 reasons search plugs often decide if a website or store ranks well or not.
Point Number #1
Enhancing User Experience And Engagement
Quite recently a study was carried out to know, what are the factors that a consumer or visitor first consider to decide whether to hit the red X or to stay on? After studied and analyzing over 200K visitors; a pattern was found and for over more than 35 percent, people escape the website, once they are unable to find the article or product that they are looking for.
The second point is navigation i.e. the basic or fundamental appeal of the website should be clean and audience or the visitors must be able to understand where and how to navigate from pages and find what they are looking for.
Takeaways
· Ease in the Search Ability
· A Well Navigated Product Page (Reachable)
Point Number #2
The Ability To Come Up With Great Results in fraction of Seconds
For the record, let’s take the example of Amazon; the insane number of products in almost each category is a mammoth task to accomplish, if it has to be done by a human.
On the contrary; the searching Algorithm A9 just takes 10sec to sort all the options and showcase it in the most subtle manner. Similarly website owners must add better search feature or add relevant filters that helps users to get exactly what they are looking for.
With the advance features and for Elastic Search and Solr Wpsolr is impeccable combination of smart search ability, easy integration, multiple platform friendly and most importantly offers an insane search speed of 200MS.
Point Number #3
Easy Integration With Multiple WordPress, Woo-Commerce Platforms
Be it a Shopify Store or website with millions and millions of pages and figuring out exactly the right and accurate pair of shoes or the exact record that you wish to see takes a significantly smart technology and WpSolr is considered as one of the most widely used search Plugin used in the world.
All these help you kill two birds with a single stone. Now get additional searching functionality in your website and easy integrated with multiple features.
To Sum Up
We hope you had a nice time going through our write up and will surely check out the advance WpSolr into your Kit. Have a good one!
0 notes
Text
Searchandising: Site search hacks that drive revenue
Improving customer experience is top-of-mind for every digital business. Billions are spent each year on mobile apps, content, personalization and omnichannel capabilities. And hundreds of hours are spent on redesigning websites and conversion optimization.
Yet CX plans often overlook a fundamental piece of the equation: site search performance.
Visitors who search are explicitly telling you what they want and are more likely to convert than visitors who browse (50% higher according to an Econsultancy survey).
Today’s best-of-breed search tools have come a long way from simple keyword matching, boasting varying degrees of autocorrection, semantic matching, machine learning and personalization.
But too often, merchandisers “set and forget” search, relying on their solutions to just work their voodoo. Rarely do merchandisers take advantage of the tuning capabilities they’ve paid for.
The result is site search behaving badly, or at least underachieving its potential. Leaving search on default settings may be efficient, but neglecting to check under the hood to ensure search shows the right products for your “money keywords” costs dollars and sense.
The scale of individual “pinhole leaks” in your system can amount to significant lost revenue every year. The good news is you can identify and correct these leaks with a simple auditing process and site search tweaks.
Auditing site search
Step 1: consult your analytics
Pull out your search analytics, and set your date range to one year. Look for high volume searches with underperforming revenue and conversion rates, or high abandonment and refinement rates, and create a short-list of 10-30 “money keywords” to optimize.
Bonus tip: During this exercise, scan your report’s top 100-500 keywords and jot down common abbreviations, misspellings and product attributes that appear. This intel can help you improve your search application’s thesaurus, and may identify helpful category and search filters.
Step 2: test your searches
Now the fun part — roll up your sleeves and play customer! Check for anything irrelevant or out of place. Wear your “business hat” as you do this, and look for opportunities to tune results to better match your merchandising strategy.
For every search you audit, note what needs to improve about the experience. For example, investigate why sunglasses are appearing in searches for “grey jackets,” or why iPhone accessories outrank iPhone handsets.

Note what issues you need to correct for every search term you audit
Optimizing relevance with search logic
Many modern enterprise search applications and digital experience platforms provide merchandiser-friendly admin tools to adjust search logic, the business rules that inform the algorithm. If you don’t have access to such business tooling, enlist a developer’s help to tune the back end (most search applications are built on Solr or Elasticsearch).
There are several levers you can pull to maximize search relevance for your “money” keywords:
Index factors
Just like Google’s ranking factors, your site search algorithm calculates relevance based on index factors such as product title, category, product description, product specs (attributes), keyword tags and other metadata.
Adjusting index factors across the board, or for specific products or categories, can tune results in favor of your merchandising strategies, and improve relevance, click-through and sell-through.
For example, if you sell high ticket electronics and find accessories and lower ticket items are sneaking their way into top search positions, your engine may be weighting product name at 200% (which would boost accessories’ score), descriptions at 150%, specs at 100% and category relevance at 75%. You can improve results by reducing product name, description and spec weighting and boosting category relevance and price.
Boost-and-bury
Advanced engines may include additional index factors such as popularity (clicks, favorites and sales), product ratings, price, margin, date added, inventory count, semantic relevance and custom attributes (e.g. brand, genre, format or category).
Some product types benefit from a specific keyword or attribute boost or bury. For example, a search for “patio furniture” should boost sets above individual items like patio chairs, and bury accessories such as cushions and covers.

Boosting patio sets within results for “patio furniture” better matches customer intent than individual pieces, and can improve basket size and revenue
Bonus tip: Use your site search’s autosuggestions (or a high-volume competitor’s) to identify terms to boost or bury, per keyword.
Synonyms
Modern search applications do a decent job of recognizing synonyms out of the box thanks to their robust dictionaries and thesauri. However, most ecommerce catalogs benefit from custom synonym mapping to handle colloquial terms and jargon, brand and product names that aren’t standard dictionary terms, and their respective common misspellings. After all, one man’s “thumb drive” is another’s “memory stick,” and one woman’s “pumps” are another’s “heels.”
A usability study by Baymard Institute found 70% of ecommerce sites failed to map synonyms and only return results that match search terms as entered. Considering brands and manufacturers often describe the same things in different ways, this hurts recall and customer experience. It can also stifle sales for products that don’t match the most frequent variants of popular product searches — the two-piece swimsuits in a world of bikinis.
And don’t forget model numbers! Baymard’s research found only 16% of ecommerce sites do.
Fuzzy logic
Most search tools employ fuzzy logic to handle plurals, misspellings and other near-matches. This increases recall (number of results returned) for a given search, and often improves results, especially for misspellings.
For example, a search for “pyjamas” would return matches for “pajamas.” Using stemming, a search including “floss” could match “flossing,” “flosses,” “flosser” and “flossers.”
However, fuzzy logic doesn’t always improve results, particularly when fuzzy matching or stemming a product or brand keyword matches attributes of other products, or other product types altogether.
For search engines that use “or” operators in their algorithms, results can appear when only one word in the query matches product information. For example, any search that includes “orange” (attribute) would return results for “Orange Boss” (brand).

“Or” operators match products to any keyword in a multi-keyword query
Understanding context and adding exclusion rules for specific searches tightens recall and maximizes the precision of your results.
For example:
plant, planted and planter salt, salts and salted blue and blues boot and booties belt and belted print, printer, and printing cook, Cook, cooker, cooking rock, rocker, rocking
Many of today’s enhanced search platforms offer semantic matching, natural language processing and learning algorithms out-of-the-box. Some are intelligent enough to detect when a keyword is intended as a product, attribute or utility of the product (such as “for older dogs”). Nevertheless, even Cadillac tools can miss some important contextual variables specific to your catalog, customer and merchandising strategy. When auditing your top search terms, look for fuzzy product matches that should be excluded or buried.
Bonus Tip: Excluding stemming variants“-ing” and “-er” and “-ed” in general across all searches can tighten search results, optimizing for relevance and sell-through.
Showing fewer matches reduces the “paradox of choice” effect which can lead to slower decision making or even indecision. A tighter set also supports mobile shoppers who have a harder time browsing and comparing products within a list on a smaller screen, and who struggle with applying filters and facets.
Searchandising with slot rules
Slot rules tell your site search engine specifically how you want to populate your product grid for a specific search. For example, you may always want the first row to show your house brand for searches that don’t include a specific brand. Or, to show only full price products in the first three positions, and flexibly rank the rest. (Not all site search tools support slot rules, but many enterprise solutions do).
Keywords that span multiple categories such as “jackets” (men’s, women’s, boys’ and girls’) and thematic searches (e.g. “Valentine’s gifts,” “white marble,” “LA Raiders” or “safety equipment”) benefit from slot rules that diversify results rather than front-load from a popular category. This helps your customer understand you carry a breadth of products and may help them refine their results, especially on mobile where fewer results are visible per screen.

Slot rules can diversify results to ensure results from certain categories aren’t overrepresented in top positions
Bonus Tip: The most efficient way to leverage slot rules is to apply them to your category lists and apply search redirects for exact-match queries. If you uncover high-volume searches that don’t have associated categories, create them! This helps customers who browse rather than search, supports guided selling and can boost SEO.

Search redirects to category landing pages can optimize the buying experience for exact-matched terms
Personalizing search
Search engines and DXPs (digital experience platforms) with machine learning capabilities are gaining popularity, promising to optimize relevance and performance with minimal effort from the business.
Semantic relevance returns product matches even when queried keywords don’t appear in descriptions or metadata.
Natural language processing identifies search intent and context such as a navigational query (looking for a category) or searching by attribute or product function (e.g. “dry food for older dogs”).
Aggregated behavioral data can match a visitor to past activity and look-alike customer segments, using predictive analytics to provide personalized recommendations.
Despite their intelligence, advanced tools suffer as much from set-and-forget implementation as their less sophisticated counterparts. Shipping with the most powerful searchandising controls, these platforms are designed for merchandising logic. But many users of these engines fail to leverage their capabilities, and never experience the full value of their technology. Why you still need to “searchandize” your personalized search engine
Machine learning takes time to get good. Highly trafficked sites with relatively evergreen catalogs benefit most, while less trafficked sites with large catalogs (thus a long search tail) or higher catalog turnover may struggle to build reliable affinities between search queries and products.
Default settings create bias. It’s well demonstrated that top search slots receive higher click-through, on average. When algorithms favor popularity metrics, the “rich get richer” over time. Search satisfaction can dwindle as SKU variants such as sizes and colors sell out, and fresh, full-margin product may be buried under discounted stock.
Tools are agnostic to your merchandising strategies. With data and time, intelligent search tools can recognize buying trends, seasonality and more. But they still lack insight into when it trend forecasts, promotional calendars, anticipated shifts in demand and other variables. By the time they catch up, this context may be stale!
To ensure personalized search serves your business in real-time, leverage index weighting, boost-and-bury and slot rules the same way you’d tune non-personalized search.
Advanced personalization
DXPs that integrate with CRM and ERP systems allow you to shape merchandising logic for individual catalogs, geographics and customer segments. For example:
Boost new items and prestige brands for high-spending segments, or boost heavy puffer jackets to New Yorkers and bury them for Californians
Strongly boost SKUs and brands previously purchased to individual B2B accounts (even if ordered offline)
Strongly bury products that aren’t available for international shipping to non-domestic visitors

Target should bury “not available for intl shipping” products for non-US shoppers
Don’t reset-and-forget!
Search tuning shouldn’t happen in a vacuum. Document your strategies every time there’s an update to merchandising logic. An audit trail ensures other team members (and future members) know what was tuned and why, and can revisit strategies as data is collected and business strategies and objectives evolve.
Consider time-limited strategies. Certain searches will benefit from tuning around seasonality, promotional events and other variables. Site-wide adjustments may also be relevant. For example, boosting sale items December 26 through January 31 helps clear excess inventory and matches buyer expectations for traditional retail. Some tools allow you to set start and rollback dates for merchandising rules. If yours doesn’t, ensure someone’s assigned to revert changes at a designated time.
Should you A/B test your tuning strategies? Your enterprise search tool or DXP may natively support A/B testing. However, because split testing requires sufficient traffic to produce reliable results for each keyword, and sends half of your traffic to untuned results, it’s often unnecessary — especially when you’re closing an obvious experience or relevance gap.
Site search doesn’t have to remain a black box. Make search tuning a regular part of your searchandising strategy to optimize your customer experience, built trust and loyalty, save lost sales and ensure search results are always in step with your ever-evolving business strategies.
Up next in this series: Tips for tuning autosuggest. Are you subscribed?
The post Searchandising: Site search hacks that drive revenue appeared first on Get Elastic Ecommerce Blog.
Searchandising: Site search hacks that drive revenue published first on https://goshopmalaysia.tumblr.com
0 notes
Text
Installation and configuration of Solr(Full-text search)
Installation and configuration of Solr(Full-text search)
Solr is an open-source full-text search engine. It is written in java language and highly used in real-time indexing and querying data using different filters. It can be used on top of a database(MySQL, Mongo) to provide a fast response to the application.
Let’s quickly set up it using the below steps on the Red hat 8 platform.
First, we need to install the java(JDK) package to resolve any…
View On WordPress
0 notes
Text
#Solr Query Syntax#Apache Solr Query Language#Solr Search Query Examples#Solr Query Parameters#Solr Query Filters#Solr Advanced Query Syntax#solr query#solr in query#Master Solr Query Syntax
0 notes
Text
300+ TOP Apache SOLR Interview Questions and Answers
Apache Solr Interview Questions for freshers experienced :-
1. What is Apache Solr? Apache Solr is a standalone full-text search platform to perform searches on multiple websites and index documents using XML and HTTP. Built on a Java Library called Lucence, Solr supports a rich schema specification for a wide range and offers flexibility in dealing with different document fields. It also consists of an extensive search plugin API for developing custom search behavior. 2. What are the most common elements in solrconfig.xml? Search components Cache parameters Data directory location Request handlers 3. What file contains configuration for data directory? Solrconfig.xml file contains configuration for data directory. 4. What file contains definition of the field types and fields of documents? schema.xml file contains definition of the field types and fields of documents. 5. What are the features of Apache Solr? Allows Scalable, high performance indexing Near real-time indexing. Standards-based open interfaces like XML, JSON and HTTP. Flexible and adaptable faceting. Advanced and Accurate full-text search. Linearly scalable, auto index replication, auto failover and recovery. Allows concurrent searching and updating. Comprehensive HTML administration interfaces. Provides cross-platform solutions that are index-compatible. 6. What is Apache Lucene? Supported by Apache Software Foundation, Apache Lucene is a free, open-source, high-performance text search engine library written in Java by Doug Cutting. Lucence facilitates full-featured searching, highlighting, indexing and spellchecking of documents in various formats like MS Office docs, HTML, PDF, text docs and others. 7. What is request handler? When a user runs a search in Solr, the search query is processed by a request handler. SolrRequestHandler is a Solr Plugin, which illustrates the logic to be executed for any request.Solrconfig.xml file comprises several handlers (containing a number of instances of the same SolrRequestHandler class having different configurations). 8. What are the advantages and disadvantages of Standard Query Parser? Also known as Lucence Parser, the Solr standard query parser enables users to specify precise queries through a robust syntax. However, the parser’s syntax is vulnerable to many syntax errors unlike other error-free query parsers like DisMax parser. 9. What all information is specified in field type? A field type includes four types of information: Name of field type. Field attributes. An implementation class name. If the field type is Text Field , a description of the field analysis for the field type. 10. Explain Faceting in Solr? As the name suggests, Faceting is the arrangement and categorization of all search results based on their index terms. The process of faceting makes the searching task smoother as users can look for the exact results. 11. Define Dynamic Fields? Dynamic Fields are a useful feature if users by any chance forget to define one or more fields. They allow excellent flexibility to index fields that have not been explicitly defined in the schema. 12. What is Field Analyzer? Working with textual data in Solr, Field Analyzer reviews and checks the filed text and generates a token stream. The pre-process of analyzing of input text is performed at the time of searching or indexing and at query time. Most Solr applications use Custom Analyzers defined by users. Remember, each Analyzer has only one Tokenizer. 13. What is the use of tokenizer? It is used to split a stream of text into a series of tokens, where each token is a subsequence of characters in the text. The token produced are then passed through Token Filters that can add, remove or update the tokens. Later,that field is indexed by the resulting token stream. 14. What is phonetic filter? Phonetic filter creates tokens using one of the phonetic encoding algorithms in the org.apache.commons.codec.language package. 15. What is SolrCloud? Apache Solr facilitates fault-tolerant, high-scalable searching capabilities that enable users to set up a highly-available cluster of Solr servers. These capabilities are well revered as SolrCloud. 16. What is copying field? It is used to describe how to populate fields with data copied from another field. 17. What is Highlighting? Highlighting refers to the fragmentation of documents matching the user’s query included in the query response. These fragments are then highlighted and placed in a special section, which is used by clients and users to present the snippets. Solr consists of a number of highlighting utilities having control over different fields. The highlighting utilities can be called by Request Handlers and reused with standard query parsers. 18. Name different types of highlighters? There are 3 highlighters in Solr: Standard Highlighter : provides precise matches even for advanced queryparsers. FastVector Highlighter : Though less advanced than Standard Highlighter, it works better for more languages and supports Unicode breakiterators. Postings Highlighter : Much more precise, efficient and compact than the above vector one but inappropriate for a more number of query terms. 19. What is the use of stats.field? It is used to generate statistics over the results of arbitrary numeric functions. 20. What command is used to see how to use the bin/Solr script? Execute $ bin/Solr –helpto see how to use the bin/Solr script. 21. Which syntax is used to stop Solr? $ bin/solr stop -p 8983 is used to stop Solr. 22. Which command is used to start Solr in foreground? $ bin/solr start –f is used to start Solr in foreground. 23. What syntax is used to check whether Solr is currently running or not? $ bin/solr status is used to check Solr running status. 24. Give the syntax to start the server. $ bin/solr start is used to start the server. 25. How to shut down Apache Solr? Solr is shut down from the same terminal where it was launched. Click Ctrl+C to shut it down. 26. What data is specified by Schema? Schema declares – how to index and search each field. what kinds of fields are available. what fields are required. what field should be used as the unique/primary key 27. Name the basic Field types in Solr? date long double text float Become Master of Apache Solr by going through this online Solr Training. 28. How to install Solr? The three steps of Installation are: Server-related files, e.g. Tomcat or start.jar (Jetty). Solr webapp as a .war. Solr Home which comprises the data directory and configuration files 29. What are the important configuration files of Solr? Solr supports two important configuration files solrconfig.xml. schema.xml Apache Solr Questions and Answers Pdf Download Read the full article
0 notes
Text
New Post has been published on Payment-Providers.com
New Post has been published on https://payment-providers.com/searchnode-publishes-report-on-ecommerce-trends-2020/
SearchNode publishes report on ecommerce trends 2020
What can we expect from the ecommerce industry in 2020? Ecommerce News Europe spoke with Antanas Bakšys, CEO and co-founder of Lithuanian tech company SearchNode, about the latest ecommerce trends.
Antanas Bakšys co-founded SearchNode in June 2013. Nordic Business Report called him one of the most promising entrepreneurs under the age of 25 in Northern Europe. With his company, he offers a search and filtering solution for medium-sized and big ecommerce players. Among its customers are Decathlon (Poland), Hubo (Belgium) and Phonehouse (Spain).
At the start of this year, SearchNode published an extensive report with the 22 Ecommerce Trends for 2020. We spoke with Antanas to find out what he thought about some of the survey findings.
One of the questions the nearly 160 decision-makers from big ecommerce companies got was “what ecommerce platform are you on now?”:
What could be the reasons more ecommerce companies are still using Magento 1 rather than Magento 2, which is already available since 2015?
“It’s quite surprising, but this should change soon. From the 1st of June 2020, Magento will no longer support Magento 1 platform. We see a trend that many companies who are using Magento 1 are currently moving to Magento 2 or other platforms. It’s a great chance to build a new website, with new functionalities and significant improvements. At the same time, something like this takes much effort and resources.”
Most companies (76 percent) want to improve personalization. What things do you think can be improved on this subject? What do ecommerce companies nowadays lack when it comes to personalization?
“It’s common for amateurs to think that a great personalization will come with a shiny tool. Especially if it costs a lot. It’s quite easy to differently target 30 or 50 segments. What is difficult and what most companies get wrong, is tailoring a message that truly resonates with those people you target. And in all channels, from the first ad to the checkout page.”
“That’s why I believe that the next two years will be about ecommerce professionals and their skills to strategize and build personalization efforts, with a support of great tools.”
The next two years will be about strategizing and building personalization efforts.
Site-search is also among the most popular things to implement, improve or change. What is, in your opinion, the current state of site-search on ecommerce websites?
“Usually, there are three types of companies to define a state of site-search. One type is the kind of company that uses open-source technologies like Elastic or Solr and just relys on their default configuration with a bit of development. Usually, these companies have a bad or very mediocre search experience. They lose lots of users and their money when customers don’t find what they are looking for.”
“Another type is those who use the same open-source technologies, but have a full-time search team of at least three to five experienced engineers and at least one product manager. Amazon, for example, has about 400 people in its search team. These companies usually have a mediocre or great search experience.”
“The last type is those who work with third party solutions. As there are tens and probably hundreds of companies providing search, we can find ecommerce sites from the very basic search experience to really advanced solutions.”
“So to sum up, the state of site-search is different, but in most cases far from perfect. This is also the reason why our business is growing.”
Site-search is in most cases far from perfect.
What should be improved then?
“Most of the advanced ecommerce companies nowadays are working on natural language understanding and data processing for search. Because it’s not enough that search has autocomplete, spellcheck and understands that ‘tomato’ and ‘tomatoes’ should find similar or identical products. It’s also not enough to add synonyms or manually adjust search results to search queries.”
“The difficult part is to truly understand a user’s query, its context and products’ data, to be able to find the most relevant products in the right order. As a quick example: when users search for a belt, they want to find belts, not dresses and pants with belts. Our CTO wrote an interesting guide about this, with the 14 ecommerce site search best practices for 2020.”
It’s quite surprising that ‘payments’ is in the top of the list. One might think most ecommerce companies have this part under control. Why is at number 4 on the list you think?
“It was a bit of a surprise for me as well. As I’m not a big expert in ecommerce payments, it’s worth studying this more. However, it might be similar to site-search, which from one point of view is well-known and developed for more than twenty years but many companies struggle with it, even if they had a ‘great’ search for over three years. The market and the users’ behavior and wishes are changing quite fast. So the companies should continuously improve. Payments are not the exception.”
Environmental sustainability is a hot topic in ecommerce. In your survey, many companies say they will use plastic-free packaging and efficient transportation to cut emissions. What can be further done in your opinion?
“It remains a tricky topic. For example, there are skeptics who generalize the whole retail industry, saying all are against the environment. In their opinion the more you buy, the more you pollute the earth. However, I think it’s impossible to turn a critical mass of people into such minimalists in today’s world, therefore I’m happy to see that ecommerce companies are actively thinking and acting to be environmentally sustainable. I noticed that it’s also a great marketing message.”
More ecommerce companies could accept their selling products for recycling or at least educate how purchased products could be recycled. Drones delivery should cut emissions if they replace trucks and cars. And so on.”
Here at Ecommerce News Europe, we have written many news articles about online retailers that have decided to become an online marketplace. It looks like a real trend. Why is this, you think?
“According to our survey, 21 percent are already marketplaces and 6 percent will become marketplaces in 2020. So almost a third of the medium to big ecommerce companies that we have questioned will be marketplaces.”
“It should be more profitable to open your platform to other sellers and take a commission from them. As many ecommerce companies already have a platform, user base and could predict sales, it’s not so difficult to turn this platform into a marketplace. What is difficult is to compete with other marketplaces and make sure your own products win when your users search for a product in the said marketplace.”
“However, I believe it’s a great opportunity for small businesses to use those platforms to sell more products, rather than trying to compete in this noisy market.”
Small businesses should join marketplaces rather than trying to fight them.
What does it say that organic search marketing still offers the best ROI for most ecommerce companies?
“It was a bit of a surprise for me as well. I always thought email marketing is the channel with the best ROI. But it looks like SEO is also profitable and that the long-term work companies do actually pays off. However, I’d be careful here and wouldn’t state that organic search marketing is the best ROI channel. Let’s say it’s one of the best channels.”
Only 31 percent of the surveyed companies are satisfied with their own site-search. Can you explain this?
“My guess is many fewer users would be satisfied with the site-search on ecommerce websites. Sometimes companies are just happy with their site-search, even though it sucks. As I explained earlier, many site-searches nowadays are not able to match a user’s query with the most relevant products. While searching for a belt, users find dresses and pants with belts. While searching for dog food, users get bowls for dog food. While searching for a Lenovo laptop with 16gb ram, users get 16gb ram parts, not laptops and so on.”
“The main challenges for the next few years are how companies will be able to process their products’ data, empower great search technology and build a continuous & scalable improvement process. It will require people who have great know-how in the ecommerce search area, not just shiny tools. This is what SearchNode is known for in the market.”
It’s about having great know-how in the search area, not about having shiny tools.
Tags Europe
Share
Source link
0 notes
Text
Original Post from Trend Micro Author: Trend Micro
By: Santosh Subramanya (Vulnerability Researcher)
Security researcher Michael Stepankin reported a vulnerability found in the popular, open-source enterprise search platform Apache Solr: CVE-2019-0192. It’s a critical vulnerability related to deserialization of untrusted data. To have a better understanding of how the vulnerability works, we replicated how it could be exploited in a potential attack by using a publicly available proof of concept (PoC).
Successfully exploiting this security flaw can let hackers execute arbitrary code in the context of the server application. For example, an unauthenticated hacker can exploit CVE-2019-0192 by sending a specially crafted Hypertext Transfer Protocol (HTTP) request to the Config API, which allows Apache Solr’s users to set up various elements of Apache Solr (via solrconfig.xml). Affected versions include Apache Solr 5.0.0 to 5.5.5 and 6.0.0 to 6.6.5.
What is Apache Solr? Apache Solr is an open-source enterprise search platform built on Apache Lucene, a Java-based library. It reportedly has a 35-percent market share among enterprise search platforms and is used by various multinational organizations.
Designed to be scalable, Apache Solr can index, query, and map sites, documents, and data from a variety of sources, and then return recommendations for related content. It supports text search, hit highlighting, database integration, and document handling (e.g., Word and PDF files) among others. It also supports JavaScript object notation (JSON) representational state transfer (REST) application programming interfaces (APIs). This means Apache Solr can be integrated with compatible systems or programming languages that support them. Apache Solr runs on port 8983.
What is CVE-2019-0192? The vulnerability is caused by an insufficient validation of request to the Config API, which lets Apache Solr’s users configure solrconfig.xml. This solrconfig.xml, in turn, controls how Apache Solr behaves in the installed system by mapping requests to different handlers. Parameters in solrconfig.xml, for instance, define how search requests and data are processed, managed, or retrieved.
Apache Solr is built on Java, which allows objects to be serialized, that is, converting and representing objects into a compact byte stream. This makes it a convenient way for the objects to be transferred over network. It can then be deserialized for use by a Java virtual machine (JVM) receiving the byte stream.
Config API allows Solr’s Java management extensions (JMX) server to be configured via HTTP POST request. An attacker could point the JMX server to a malicious remote method invocation (RMI) server and take advantage of the vulnerability to trigger remote code execution (RCE) on the Solr server.
How does CVE-2019-0192 work? An attacker can start a malicious RMI server by running a command, as seen in our example in Figure 1 (top). The ysoserial payload with class JRMPListener can be used to embed the command touch /tmp/pwn.txt, which can then get executed on a vulnerable Apache Solr. A POST request (Figure 1, bottom) can then be sent to Solr to remotely set the JMX server.
Figure 1. Snapshots of code showing how a malicious RMI server is started (top), and how a POST request is sent (bottom)
JMX enables remote clients to connect to a JVM and monitor the applications running in that JVM. The applications can be managed via managed beans (MBeans), which represents a resource. Through MBeans, developers, programmers, and Apache Solr users can access and control the inner workings of the running application. MBeans can be accessed over a different protocol via Java RMI. Apache Solr users who want to use JMX/RMI interface on a server can accordingly create a JMXService URL (service:jmx:rmi:///jndi/rmi://:/jmxrmi).
In the example showed in Figure 2, the attacker, exploiting CVE-2019-0192, could use a POST request and set the JMXService URL (jmx.serviceUrl) remotely via Config API using the ‘set-property’ JSON object.
As shown in Figure 3, it would return a 500 error, including the string “undeclared checked exception; nested exception is” in the response body.
Figure 2. Code snapshot showing how the JMXService could be set remotely
Figure 3. Snapshot of code showing the error 500
Due to improper validation, this jmx.serviceUrl can be pointed to an attacker-controlled JMRP listener (which is typically used to notify about events or conditions that occur). This causes the vulnerable Apache Solr to initiate an RMI connection to a malicious JMRP Listener. A three-way handshake will then be initiated with the malicious RMI server to set up a connection with the malicious RMI server.
An attacker can then take advantage of this to carry out RCE on the vulnerable Apache Solr. As shown in Figure 4, an attacker, for instance, can send a maliciously crafted serialized object.
Figure 4. Snapshot showing data transmission after exploiting CVE-2019-0192
How to address this vulnerability Apache Solr recommends patching or upgrading to 7.0 (or later) versions. It’s also advised to disable or restrict Config API when not in use. The network should also be proactively configured and monitored for any anomalous traffic that may be running on hosts that has Apache Solr installed.
Developers, programmers, and system administrators using and managing Apache Solr should also practice security by design as well as enforce the principle of least privilege and defense in depth to protect against threats that may exploit this vulnerability.
The Trend Micro Deep Security and Vulnerability Protection solutions protect user systems from threats that may exploit CVE-2019-0192 via this Deep Packet Inspection (DPI) rule:
1009601 – Apache Solr Remote Code Execution Vulnerability (CVE-2019-0192)
Trend Micro TippingPoint customers are protected from attacks that exploit CVE-2019-0192 this MainlineDV filter:
313798 – HTTP: Apache Solr Java Unserialized Remote Code Execution Vulnerability
The post CVE-2019-0192: Mitigating Unsecure Deserialization in Apache Solr appeared first on .
#gallery-0-5 { margin: auto; } #gallery-0-5 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 33%; } #gallery-0-5 img { border: 2px solid #cfcfcf; } #gallery-0-5 .gallery-caption { margin-left: 0; } /* see gallery_shortcode() in wp-includes/media.php */
Go to Source Author: Trend Micro CVE-2019-0192: Mitigating Unsecure Deserialization in Apache Solr Original Post from Trend Micro Author: Trend Micro By: Santosh Subramanya (Vulnerability Researcher) Security researcher Michael Stepankin…
0 notes
Text
Adding Search to Your Site with JavaScript
Static website generators like Gatsby and Jekyll are popular because they allow the creation of complex, templated pages that can be hosted anywhere. But the awesome simplicity of website generators is also limiting. Search is particularly hard. How do you allow users to search when you have no server functions and no database?
With JavaScript!
We’ve recently added Search to the TrackJS Documentation site, built using the Jekyll website generator and hosted on GitHub Pages. GitHub wasn’t too keen on letting us run search functions on their servers, so we had to find another way to run full-text search on our documentation.
Our documentation is about 43,000 words spread across 39 pages. That’s actually not much data as it turns out–only 35 kilobytes when serialized for search. That’s smaller than some JavaScript libraries.
Building the Search Index
We found a project called Lunr.js, which is a lightweight full-text search engine inspired by solr. Plus, it’s only 8.4 kilobytes, so we can easily run it client-side.
Lunr takes an array of keyed objects to build its index, so we need to get our data to the client in the right shape. We can serialize our data for search using Jekyll’s native filters like: xml_escape, strip_html, and jsonify. We use these to build out an object with other important page context, like page title and url. This all comes together on a search.html page.
<ol id="search-results"></ol> <script> window.pages = { }; </script> <script src="/lunr-2.3.5.min.js"></script> <script src="/search.js"></script>
The above HTML fragment is the basic structure of the search page. It creates a JavaScript global variable, pages, and uses Jekyll data to build out the values from site content pages.
Now we need to index our serialized page data with lunr. We’ll handle our custom search logic in a separate search.js script.
var searchIndex = lunr(function() { this.ref("id"); this.field("title", { boost: 10 }); this.field("content"); for (var key in window.pages) { this.add({ "id": key, "title": pages[key].title, "content": pages[key].content }); } });
We build out our new searchIndex by telling lunr about the shape of our data. We can even boost the importance of fields when searching, like increasing the importance of matches in page title over page content. Then, we loop over all our global pages and add them to the index.
Now, we have all our documentation page data in a lunr search engine loaded on the client and ready for a search anytime the user visits the /search page.
Running a Search
We need to get the search query from the user to run a search. I want the user to be able to start a search from anywhere in the documentation–not just the search page. We don’t need anything fancy for this, we can use an old-school HTML form with a GET action to the search page.
<form action="/search/" method="GET"> <input required type="search" name="q" /> <button type="submit">Search</button> </form>
When the user enters their search query, it will bring them to the search page with their search in the q querystring. We can pick this up with some more JavaScript in our search.js and run the search against our index with it.
function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] === variable) { return decodeURIComponent(pair[1].replace(/\+/g, "%20")); } } } var searchTerm = getQueryVariable("q"); // creation of searchIndex from earlier example var results = searchIndex.search(searchTerm); var resultPages = results.map(function (match) { return pages[match.ref]; });
The results we get back from lunr don't have all the information we want, so we map the results back over our original pages object to get the full Jekyll page information. Now, we have an array of page results for the user's search that we can render onto the page.
Rendering the Results
Just like any other client-side rendering task, we need to inject our result values into an HTML snippet and place it into the DOM. We don't use any JavaScript rendering framework on the TrackJS documentation site, so we'll do this with plain-old JavaScript.
// resultPages from previous example resultsString = ""; resultPages.forEach(function (r) { resultsString += "<li>"; resultsString += "<a class='result' href='" + r.url + "?q=" + searchTerm + "'><h3>" + r.title + "</h3></a>"; resultsString += "<div class='snippet'>" + r.content.substring(0, 200) + "</div>"; resultsString += "</li>" }); document.querySelector("#search-results").innerHTML = resultsString;
If you want to put other page properties into the results, like tags, you'd need to add them to your serializer so you have them in resultsPages.
With some thought on design, and some CSS elbow-grease, it turns out pretty useful!
I'm pretty happy with how it turned out. You can see it in action and checkout the final polished code on the TrackJS Documentation Page. Of course, with all that JavaScript, you'll need to watch it for bugs. TrackJS can help with that, grab your free trial of the best error monitoring service available today, and make sure your JavaScript keeps working great.
The post Adding Search to Your Site with JavaScript appeared first on David Walsh Blog.
Adding Search to Your Site with JavaScript published first on https://appspypage.tumblr.com/
0 notes
Text
Adding Search to Your Site with JavaScript
Static website generators like Gatsby and Jekyll are popular because they allow the creation of complex, templated pages that can be hosted anywhere. But the awesome simplicity of website generators is also limiting. Search is particularly hard. How do you allow users to search when you have no server functions and no database?
With JavaScript!
We’ve recently added Search to the TrackJS Documentation site, built using the Jekyll website generator and hosted on GitHub Pages. GitHub wasn’t too keen on letting us run search functions on their servers, so we had to find another way to run full-text search on our documentation.
Our documentation is about 43,000 words spread across 39 pages. That’s actually not much data as it turns out–only 35 kilobytes when serialized for search. That’s smaller than some JavaScript libraries.
Building the Search Index
We found a project called Lunr.js, which is a lightweight full-text search engine inspired by solr. Plus, it’s only 8.4 kilobytes, so we can easily run it client-side.
Lunr takes an array of keyed objects to build its index, so we need to get our data to the client in the right shape. We can serialize our data for search using Jekyll’s native filters like: xml_escape, strip_html, and jsonify. We use these to build out an object with other important page context, like page title and url. This all comes together on a search.html page.
<ol id="search-results"></ol> <script> window.pages = { }; </script> <script src="/lunr-2.3.5.min.js"></script> <script src="/search.js"></script>
The above HTML fragment is the basic structure of the search page. It creates a JavaScript global variable, pages, and uses Jekyll data to build out the values from site content pages.
Now we need to index our serialized page data with lunr. We’ll handle our custom search logic in a separate search.js script.
var searchIndex = lunr(function() { this.ref("id"); this.field("title", { boost: 10 }); this.field("content"); for (var key in window.pages) { this.add({ "id": key, "title": pages[key].title, "content": pages[key].content }); } });
We build out our new searchIndex by telling lunr about the shape of our data. We can even boost the importance of fields when searching, like increasing the importance of matches in page title over page content. Then, we loop over all our global pages and add them to the index.
Now, we have all our documentation page data in a lunr search engine loaded on the client and ready for a search anytime the user visits the /search page.
Running a Search
We need to get the search query from the user to run a search. I want the user to be able to start a search from anywhere in the documentation–not just the search page. We don’t need anything fancy for this, we can use an old-school HTML form with a GET action to the search page.
<form action="/search/" method="GET"> <input required type="search" name="q" /> <button type="submit">Search</button> </form>
When the user enters their search query, it will bring them to the search page with their search in the q querystring. We can pick this up with some more JavaScript in our search.js and run the search against our index with it.
function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] === variable) { return decodeURIComponent(pair[1].replace(/\+/g, "%20")); } } } var searchTerm = getQueryVariable("q"); // creation of searchIndex from earlier example var results = searchIndex.search(searchTerm); var resultPages = results.map(function (match) { return pages[match.ref]; });
The results we get back from lunr don't have all the information we want, so we map the results back over our original pages object to get the full Jekyll page information. Now, we have an array of page results for the user's search that we can render onto the page.
Rendering the Results
Just like any other client-side rendering task, we need to inject our result values into an HTML snippet and place it into the DOM. We don't use any JavaScript rendering framework on the TrackJS documentation site, so we'll do this with plain-old JavaScript.
// resultPages from previous example resultsString = ""; resultPages.forEach(function (r) { resultsString += "<li>"; resultsString += "<a class='result' href='" + r.url + "?q=" + searchTerm + "'><h3>" + r.title + "</h3></a>"; resultsString += "<div class='snippet'>" + r.content.substring(0, 200) + "</div>"; resultsString += "</li>" }); document.querySelector("#search-results").innerHTML = resultsString;
If you want to put other page properties into the results, like tags, you'd need to add them to your serializer so you have them in resultsPages.
With some thought on design, and some CSS elbow-grease, it turns out pretty useful!
I'm pretty happy with how it turned out. You can see it in action and checkout the final polished code on the TrackJS Documentation Page. Of course, with all that JavaScript, you'll need to watch it for bugs. TrackJS can help with that, grab your free trial of the best error monitoring service available today, and make sure your JavaScript keeps working great.
The post Adding Search to Your Site with JavaScript appeared first on David Walsh Blog.
Adding Search to Your Site with JavaScript published first on https://deskbysnafu.tumblr.com/
0 notes
Text
Designing and Building Big Data Applications training, riyadh, saudi arabia.
Designing and Building Big Data Applications training,riyadh,saudi arabia
Designing And Building Big Data Applications Course Description
Duration: 4.00 days (32 hours), RM 3200
This four day training for designing and building Big Data applications prepares you to analyze and solve real-world problems using Apache Hadoop and associated tools in the Enterprise Data Hub (EDH).
You will work through the entire process of designing and building solutions, including ingesting data, determining the appropriate file format for storage, processing the stored data, and presenting the results to the end-user in an easy-to-digest form. Go beyond MapReduce to use additional elements of the EDH and develop converged applications that are highly relevant to the business.
Intended Audience For This Designing And Building Big Data Applications Course
» This course is best suited to developers, engineers, architects, data scientist who want to use use Hadoop and related tools to solve real-world problems.
Designing And Building Big Data Applications Course Objectives
» Creating a data set with Kite SDK
» Developing custom Flume components for data ingestion
» Managing a multi-stage workflow with Oozie
» Analyzing data set with Pig
» Analyzing data with Crunch
» Writing user-defined functions for Hive and Impala
» Transforming data with Morphlines
» Indexing data with Cloudera Search
Designing And Building Big Data Applications Course Outline
Application Architecture
Scenario Explanation
Understanding the Development Environment
Identifying and Collecting Input Data
Selecting Tools for Data Processing and Analysis
Presenting Results to the Use
Defining and Using Data Sets
Metadata Management
What is Apache Avro?
Avro Schemas
Avro Schema Evolution
Selecting a File Format
Performance Considerations
Using the Kite SDK Data Module
What is the Kite SDK?
Fundamental Data Module Concepts
Creating New Data Sets Using the Kite SDK
Loading, Accessing, and Deleting a Data Set
Importing Relational Data with Apache Sqoop
What is Apache Sqoop?
Basic Imports
Limiting Results
Improving Sqoop--s Performance
Sqoop 2
Capturing Data with Apache Flume
What is Apache Flume?
Basic Flume Architecture
Flume Sources
Flume Sinks
Flume Configuration
Logging Application Events to Hadoop
Developing Custom Flume Components
Flume Data Flow and Common Extension Points
Custom Flume Sources
Developing a Flume Pollable Source
Developing a Flume Event-Driven Source
Custom Flume Interceptors
Developing a Header-Modifying Flume Interceptor
Developing a Filtering Flume Interceptor
Writing Avro Objects with a Custom Flume Interceptor
Managing Workflows with Apache Oozie
The Need for Workflow Management
What is Apache Oozie?
Defining an Oozie Workflow
Validation, Packaging, and Deployment
Running and Tracking Workflows Using the CLI
Hue UI for Oozie
Analyze data set with Pig
What is Apache Pig?
Pig's Features
Basic Data Analysis with Pig
Filtering and Sorting Data
Commonly-Used Functions
Processing Complex Data with Pig
Techniques for Combining Data Sets
Pig Troubleshooting and Optimization
Processing Data Pipelines with Apache Crunch
What is Apache Crunch?
Understanding the Crunch Pipeline
Comparing Crunch to Java MapReduce
Working with Crunch Projects
Reading and Writing Data in Crunch
Data Collection API Functions
Utility Classes in the Crunch API
Working with Tables in Apache Hive
What is Apache Hive?
Accessing Hive
Basic Query Syntax
Creating and Populating Hive Tables
How Hive Reads Data
Using the RegexSerDe in Hive
Developing User-Defined Functions
What are User-Defined Functions?
Implementing a User-Defined Function
Deploying Custom Libraries in Hive
Registering a User-Defined Function in Hive
Executing Interactive Queries with Impala
What is Impala?
Comparing Hive to Impala
Running Queries in Impala
Support for User-Defined Functions
Data and Metadata Management
Understanding Cloudera Search
What is Cloudera Search?
Search Architecture
Supported Document Formats
Indexing Data with Cloudera Search
Collection and Schema Management
Morphlines
Indexing Data in Batch Mode
Indexing Data in Near Real Time
Presenting Results to Users
Solr Query Syntax
Building a Search UI with Hue
Accessing Impala through JDBC
Powering a Custom Web Application with Impala and Search
0 notes