 Good morning, everyone. Thank you for coming. My name is Tanayasai. I work with Acvia out of India as a technical services manager, and this is my first presentation ever to a large audience like this, so pardon me. I did a small one at a local camp, but not too, so I'm a bit nervous, and so is my colleague. So if you fumble somewhere, please pardon that, and if you had taken any Acvia certification, probably you might have stumbled upon my website, which has a bunch of certification guides, and or if you had recently tried out d8cards.com, which is a Drupal activity-based D8 tutorial, you might have stumbled upon my site as well. So, yeah, and this is my colleague, JK. Hi, everyone. I'm Jay Krishnan, Jaypal, working in Acvia for us as a technical architect, and here we go. So we work out of here south of India, both of I and JK work remotely, although we have an office in Delhi, which is in the north of India. We keep shuttling from the south to the north almost every other week. And before we dive in, is there anyone who has already developed with solar? And to what extent have you used solar anyone so far? Awesome, that is great. And to set the expectations, like we intend to do everything that we can do out of the box without writing any code in this session. In this session, we'll be building a small website. I'll be showing wireframes of what we'll be building before we dive in. And we won't be writing any code at all in this session. And the modules and software that we use are Drupal 8, obviously, and the modules are Search API, which is a search framework available for Drupal. It's a contract module. I'm pretty sure many of you are already familiar with that. And Search API Solar, which allows, this module allows Search API to use Apache Solar as the search backend. And we'll also be using Facets module, which allows you to build these filters as blocks that you can use to drill down into the search results. And one thing that we won't be using this, you might not see this in action today, but when you are setting up your Search API Solar module, you might be required to add this library to your Drupal build, which is Solarium. This is what these are the things we'll be using on our demonstration today. And I won't go deep into what is Solar. I believe, like most of you, as you mentioned, that you have already worked with Solar are familiar with it. And it's an open source search platform built on Java called Lucene. And who uses Solar? As you can see, this is a screenshot from apache.org website, big names like Netflix, Disney, and all using Solar on the search on their website. So firstly, if we talk about why we need Solar in the first place, it essentially boils down to the search in Drupal Core being very slow and also not being scalable. And some features that you would find in most searches like stemming, we'll talk about what is stemming as well. Stemming and highlighting spell check are not out of the box or tricky to accomplish with the core search. And also, when you search for phrases, the search that is available in core doesn't really work great unlike it works with words. So these are the few reasons many customers and many projects go for Solar instead of core search. So essentially, you can summarize this as a Solar to be giving you fast access to big data on a budget. So it doesn't really cost much, and you should be able to spin up a typical Solar instance for as less than $10 a month. And when we speak of hosting Solar, like apart from the web server that you have your Drupal instance on, you would also need to have a Solar instance. It could be on the same machine that has your web server, or it could be on a different machine, although most of the times you would opt for a different machine. And some of the options you could consider, Acquia Search. So if you are building with Acquia Cloud, Acquia Search comes bundled with Acquia Cloud. And it's very easy to integrate. Like you would not even need to do any configuration, like just enabling the Acquia Connector module. Let's you connect directly into the Acquia Search instance. And one more option we are trying out recently is hostedapachysolar.com. This was nice as well. It is actually built and maintained by one of our colleagues, Jeff Gerling, whom you would probably know. And we stumbled upon this one yesterday at the booth. So measuredsearch.com, they provide similar hosted Solar solution. And you could also choose to set up an instance from scratch yourself on AWS or similar. And there are not too complex. And Solar is very well documented. And there are multiple block pieces about setting up Solar on any Linux instance. And to add to some context, like any of you who had worked with D7 on Solar would probably already know that we used to have two popular choices to implement Solar on D7. There used to be this Search API module. And there also used to be this Apache Solar module. And both of them were good in their own ways. But now with the D8, so these two modules have combined their forces. And we have one larger Search API module, which is amazing. I'll take all the questions at the end if you have any. So save your questions for the end. And we try to close this at least 20 minutes before the hour. So we have some time for questions if you have. And I'm not going through the process of, so we'll be building two views essentially, showcasing various things that you could do with Solar. I'll be doing the first part while my colleague JK will be doing the second part. In the interest of time, the first part, which is very basic, we're not building it live here. Instead, we have recorded some videos last night, which I'll be walking you through. And the second part, we intend to do it on a live website. And although we have a video as well, and all the site building that we do, I'll be sharing the link that has these videos at the end of my session. So as I said, I'm not going through the installation of Search API module. It's fairly very similar to how you would install any other module. And once you install Search API, this is essentially the configuration page that you would see. It won't have anything but just two links to add a server and add index. So server is essentially the hosted solar solution or the one that you set up earlier, the solar instance that you have set up. We will need to tell Search API about where that server is located and how to connect to it. That is what we would do when we add a server. And anyone not familiar with the term index so far? Like, I mean, I would take that as a no. Essentially, index is a cataloged way of having all the content indexes, our search backends a catalog of content. So it would be easier for the server to pick up to retrieve results whenever we do any search query. And we'll also see in the session how we add an index and how we add a server. And what we'll be building will look something like this. We'll be building a simple site search. So we'll be replacing the search in core. We have a simple site. I'll show you the content types you have got. And what we would be building is a very simple search, which has a search box, as you can see on the left, and a search button. And it is expected to show the search results matching those keywords in a very simple format like you would see on any search result with a title and a snippet of text. And so we have the site which has an article content type, which is just a title and some content and some tags around it. And we also have a phone content type, which allows us to store the phone title, like say iPhone 6S Plus, and also the various parameters and the configuration details of it. So we have a field for each of them, like operating system, camera resolution, and built-in storage options available, and such. And what we intend to build, so we have a content which has many of these phones, and what we intend to build is, this is the second part where we build something like this, just like you would see on Amazon or any website when you are searching for a phone, where you see the search results and a bunch of facets. So this is what we call facets when the filters on the left that you see which would allow you to drill down into the results to narrow down your selection, to match the parameters that you specify on these filters. So that is what we will try to build in this session. So first, a very simple site search, which has a search box and shows the results matching the keywords on the right. And the second will be a small tool that will help you find the phone that suits your needs. And, yep, when speaking of facets, I'm pretty sure most of you would have stumbled upon something like this. This is a screenshot from Amazon India where we have a bunch of facets that will allow me to drill down the phones by rating and price, discount, below discounts in India. So as I said, adding the server, I won't be doing it right now, although I'll be walking you through the screenshots. It's fairly simple. Like once you have procured a hosted solar solution, be it from Acquia Cloud or Acquia Search or one of the other options which I mentioned, this one is from hostedapachysolar.com. And once you procure any hosted solar instance or when you set up one yourself, you would be getting these details, the hosts, the port, the path and the name of the search score, which is what you would be required to key in when you say add server on your search API configuration. So the page looks like this. You would give a name and the backend would be solar and you could leave the solar connector to standard. And the details which I showed on the earlier screenshot, which you got from your solar vendor, you would key them in here and you can leave the rest of the configuration to the default values which work fine out of the box. And at the end, you would have an option like this which you could enable if you intend to use the same solar server for multiple websites on your multi-site setup. But you could leave it unchecked if you are just using it for a single simple website. As I said, now I'll walk you through that video which we have which shows building the index and then we'll do a simple site building which shows building the view that is required for the site wide search. And then my colleague JK will be walking you through building the more complex facets for the phone finder tool. We're starting with going to the search API configuration page. So here I have my server already added. You can ignore the second part where there's an index here. You would have just a server that you added in the earlier step. And I'll go with adding an index here. The index could have any name. And since I'm going to build one for my site search and the phone finder tool, I will key in an appropriate name. And this bunch of options here allow you to define what content from your Drupal site is to be indexed by this index. And it could be content here which refers to nodes. And you could also index blocks. This is especially useful when you are, when all the data that you have on any specific page is not belonging to just the fields that you have on that content type but on some blocks as well, especially when you are using panels, panelizer to have our paragraphs to refer to individual pieces of content on your landing pages. Although in this demonstration, we'll be sticking to the simple content where and assuming, wherein we have all the actual fields that we're indexing attached to the content type itself. And if you have some content on your terms and if your terms have fields, et cetera, you could select or if you want users, user details to be indexed as well and available on search, you could use other options about taxonomy, user, et cetera. And since I selected content, the next piece of configuration allows me to define what content types I would want to be indexed. And as I said in this site, I have an article content type, a phone content type and a basic content type which was available by default. Although I would want just the article and phone content types to be indexed. And if it is a multi-lingual website, you could define like what languages of content is to be indexed again. And in our case, it's just a single website that has only English content. I would leave the configuration to its default value. This is a bit tricky here, like especially when you are selecting the content types, it would initially, the first radio button will be clicked and I was actually enabling two content types and I was trying to see my search results. I could not find them until I read the labels here because intuitively when I selected just two content types, what it was saying was all except those selected content types, which was a default option that was selected. So keep an eye on that when you... And I will attach this index to one of the servers which I added in the earlier step. So in your case, probably if you're doing it for the first time you would have just one server. And you'll have an option here that will allow you to index immediately. So when you create any node or when you update any node, Drupal would need to send that updated details or new content to your solar server. And you could choose to have that happen immediately as you edit the index or if you leave this unchecked, Drupal will be sending that content to the solar server only on crown runs. And you can select how many pieces of content or nodes should be sent in one bunch on each crown. If you have a small site with not a lot of content that is very frequently updated, you can choose to select, you can choose to index the content immediately. If you have larger website where there is more frequent content rating, it is more recommended for performance reasons to have the content be indexed in batches through crown. And now I would need to tell my index what fields it should index. And so when you add a index, this is what you would see. You can run the initial index since it has just probably 10 nodes, it was very fast. So you'll be able to configure fields and processors here will go through both of them. And when you add a field, you need to very specifically add each field that you would want to be part of your index. And that would be every field that you intend to show on your view. Like when we saw the phone finder view, we had a bunch of fields that were displayed in the view. And also every field that you intend to use as a filter in the facets. I'm going to very quickly, so in this case I have my title field here and I have my body field here. I'll make sure I add both of them to my index. And the same with article as well. So I have these two fields on both my content types, article as well as body. And both of them actually use the same field. So I need to just add them once. And there are the specific fields about processor type and brand and features which are available only on my phone content type, which I will make sure to add to my index as well. And so these three fields over here, the title and the body text here and the image over here and the price field. I'll be adding all of them one after another. Adding the brand field and the features field and the price field, the image field. Okay, probably while I was making this video, I was not sure which image field to add because there was one image field in the article content type and there were two image fields essentially with the same label but with different machine names. So again, one reason why we should be more careful when labeling the fields. So this list actually shows all the fields from all the content types, not really sorted per content type. And once I have all my fields, and sorry about that watermark on that video by the way. So once you have all the fields added, you would have options, you would need to define what type of field it is to solar and any, so when it comes to text, you would see two options, one is string and one is full text. So any field that you intend to be available through textual search, you would need to mark it as full text and any shorter text fields that you intend to use in the facets or any other type of filter, you would be marking them as a string and the rest of integer decimal are very similar to what you would have as a field type on your Drupal as well. So these are the field types that we are defining to solar index about how solar should pursue these fields. And when I have multiple text fields, full text fields, you will see an option, a configuration here called boost. So what this boost allows you to do is if I search for a keyword and if that keyword is available in the title of my content on one node and in the body of my content in another node, I can increase the boost value of the title field so that the search results would show that the result that has the keyword in the title field first and gives lesser importance to the another search result which has the same keyword in the body field. And as I said, brand is a text field as well. Text or select list fields or even tax on me term reference fields as long as you are using them only in filters and not in or as long as you are using them in the filters like you need to make sure that you mark them as string fields and not full text fields. I'm gonna save my changes. So far we have built a index and marked the fields that we need to have on this index. And we are now getting into this processors tab which allows you to do some pre-processing and post-processing on the search results and the way they are indexed. The content is indexed. You have a bunch of options here. I don't go in detail about all of them. So enabling content access, what it does is if you have this checkbox enabled, if someone did a search result, only if they had access to that particular node via Drupal permission system that is when Solar would return this as one of the search results. So for example, if you had a content type which was restricted to a particular role and if that was available in the search result because Solar was indexing and the same content was viewable by rest of everyone on the search results because Solar was indexing all the content and showing all the results to all roles that would be bad, right? So that is when you would enable this checkbox. And similarly, anti-status would make sure only published content is shown on the search results. Highlight this field in the keyword in the search result. And you can make it ignore case. So if I search for Samsung with a capital S and if my content had Samsung with a small S, I would still want that content to be shown in the search results. So I will be enabling this ignore case flag here. And ignore characters, actually, this could be left unable. Like if you would want to ignore any special characters while indexing and when comparing with the keyword, you could do that. And those special characters can be configured at the bottom of this page. And here you will be able to configure the special characters. And we also chose to ignore HTML markup and you can configure what markup and what tags you would want to be indexed and not indexed. So here we go. We are almost done with creating the index and the next item would be building this view which building this particular view as you see on the right. So trying to display the search results like this and also building the search box. We'll be using a exposed filter of a view to build this. And let us see how we do it. I start by going to the views page and clicking on add view just like I would do with any other while building any other view. I'm going to give that name which defines it appropriately which is site search because I intend to use that view to display search results when I perform a search on my site search bar. And the main thing you need to probably note here is when you build a normal view, you would be selecting content or comments or users or tax on me terms depending on what you are building this view on. In this case you would be selecting the index which you created in the earlier step. So the index that you created in the earlier step would be available over here and you will be selecting that index. And I would want a page for it so that is where my search results will be shown. So and I'll give a title which looks fine and this would be the URL. And as my wireframe shows like we, yeah, Unfornmented List, this is about how you would want the search results to be displayed just like you would do with any other view. And so there are a couple of, so search API solar module is evolving and there are a couple of bugs here and there and I'm pretty sure when you try to do the same you'll be stumbling into a similar bug. So one of which is the preview would not actually update until we hit the save button on that view which is not usually the expected case. Also what we, when we started making this recording and our preparation, we used a search API module which was a few days old. We'll be also talking about what versions of modules works and what, and the issues with the module versions in the last, at the end of our session. So if you see me hitting the view, save a view button again and again, that is because it would not reflect the, it would not update the preview unless I do so. And I'm going to add some fields here and one field I'm adding is the search except field which comes from solar. And I'll be doing something here which actually I'll try to keep track of time. I think we're already over it. So I'm going to run through this a bit fast but this is very similar to how you would add fields to any typical, any view except that whenever you are searching for a view you would find two options. One is the view, the field name itself and the field name with a bracket that says indexed field. So any view, any field that is present in your search index will be available with that indexed field label. And I'm going to add the body tag while my title field was already there. Yep, as I said, so this body refers to the body field that is present in the database of your website while this body field refers to the body field present in your search index. So what I did here was sometimes the search, sometimes the search except field doesn't really show up because of a current issue that is open with search API module. So we're adding a fallback here where we're saying we would want to show the body field directly if the search except field isn't turning up and how we do that is, so we added this, so we added this body field although we enabled the checkbox that says display this field and at the same time for the search except field, we excluded this body field from the display and on the search except field when we give the displacement character as the fallback for a no result value. It's something to do with views more than solar. If you want to keep this simple you can just add the title field and the search except field and that should pretty much work in 90% of the cases. So here is how my site search looks at this point of time. As you can see, it's just showing all the results available and we haven't built the filters yet which we'll be doing right away. So now we have built a view that just shows all the search results, all the results available and now we would want to build that little search box over here and we'll be doing it through an exposed filter of the view. So I'm going to edit the view which I built in the earlier step and I'm going to add a filter and you'll find this new field which you would not usually see which is a full text search when you have your index added and here I can configure just like you would see with any exposed filter you will enable this checkbox which makes this filter available on the top of the view and this is very similar to how you would build a view with an exposed filter and the only thing you would probably need to take care of is selecting the fields which are available in the index which are actually full text fields and I'm going to save that view and you should be able to see this filter on the top which would allow you to search for any term and the view will be filtered to show only the matching results and again this is not in the sidebar as I did as we saw on the wireframe and the way that we move it to the sidebar is very similar to what you would do with any view which is you would expose the form by changing this parameter here to yes and that will now be available in your block layout and you can place that block anywhere and now once placed this search bar block will now be available in the I placed it in the sidebar first region so you have it here and this is how you could very easily replace a your site search with a very simple view that you built which uses solar on the back end I'll pass this on to JK who will be demoing on how we would build the facets for this phone finder over to you JK as the time is very less he's asking me to just show the videos and just pass it on okay so okay so here is the wireframe which we are planning to do it's a phased filter it's a search filter the brand features and prices will be there I will try to implement this so here I have a list of items which we need to do to accomplish the phased part first we'll check the index whether we have added all the fields required for showing in the search results page both the search filter and also on the right side section where we have image, title and description part and also price we'll do that and we'll create a views then so the views is nothing but the same way which we have created now for the site search but it will show only the type of phones and then we'll enable phased module then we'll create a brand phased so this is the plan now the same way like how you create the brand phased you will do the same way for price exposed filter and also the features phased and you just need to place a block on the left side section now we'll check whether we have added all the we have added all the fields on the index or not before going into that I just want to show you okay it's not that before just jumping on to that okay let's play this so we have now the site search I'm just going to the fields I'm making sure that we need this brand and features and price all the fields I'm just checking whether it's there or not so here the important point is that the title and body should be full text whenever because all the keywords will be passed to that title and body and we can retrieve that and all the other items like brand and operating system and price features other than a price it should be string then only it will be appearing on the phased filter search filter so we'll we need to make sure of that and the price can be a decimal and we have added a content type so that the type will be I mean currently we have added all the content on the index so there is a lot of chance it will retrieve both articles or blogs which you have in the site and for now for phone finder I don't want to show all the articles or blogs so we can add content type as a filter on the in the index and then we can use that and same way with the image like we are not going to index the complete image as a binary it's a binary so we'll use the media name which will be added in image I'm just adding here I'm just making sure the phases module is enabled and we'll add a view we'll name it as phone finder and again we'll add the index properly we are not seeing both aqueous search solar index and the phone finder index which was added earlier on the videos I've just deleted that this is the one which is having all the fields so we'll name it as phone finder and we'll have the path phone finder and I'm just making use of the table format so by default only the body fit will be there we'll add all other fields which is required and here I'm using this image which is indexed I use all the fields I'm just adding and rearranging it so that it'll be formatted properly stop me anywhere if you find like I want to know more details on this place how you did that if you have such things please stop me there I will explain more or I will make it slow so these are all just adding fields on the page I'm just removing the HTMLs which I don't want I'll go to the phone finder so here we have the phone finder the view which we have created okay so these are all the phased source which will be added by default when you are adding any index whenever you are creating any view based on the index so you have to select the source where you want to add the phased so I'm going to select the phone finder and I'm going to add the phased in the phone finder page so here we have a list of options which we can keep it on the search filter if you have seen the wireframe if you remember the wireframe the left hand side we have check boxes and we do have multiple options like that it can be a drop down or it can be a date list and all the options are open so for me I need a list of check boxes I'm selecting it and here we have some more settings on the result you can show like how many search results came for the particular keyword so that options can be selected in the settings and also we have some more options like by default in the search API and the phased when you are enabling it will give you the result but with the term ID if you are adding any taxonomy terms it will give you the term ID in the left so I don't want to use a TID I want to place a name for that so you can select that transform entity ID into label and here also we have some options like either I want to have or operator in between the phased items or I can have under option and if I don't have any phased available then I can just mark it as a display as a text and this is one more option the sorting of phased like when we are going to the phone finder page when I'm having some results in the left hand side we can see many options but it can be having like the sorting order can be different it can be either based on the search results what we had or it can be based on the count number of count how many results came from the index as a solar index and also the display value so these are all my multiple options I'm just removing the active state else yeah I will show you that first it's appearing it's not coming here I whenever you are creating a phased it will not appear directly on the page where you want so you have to create a block out of it so I'm just going to block layout and finding a phased's block by default I'm not selecting any other options you can leave it open or I can say like I want this brand phased to be available only on the phone finder page there we go this is how it's up here it's appearing the phased there is some CS issue we can correct it later or definitely we are not going to use this team in the production so similarly we can build all other phaseds now I will show you on the price phased which is a little bit different it's having a grouping item so how do you have a phased for a range so that can be shown here for that I'm not creating a phased actually that's going to be an exposed form exposed form block and also I see that I have all the content including the articles so which I want to filter it out just add the type I will add the price this is a small difference between the normal exposed filter and this particular range filter so we'll use grouped field filters I'm just selecting grouped and providing some values like less than or so this options you can keep it like less than 200 or 200 to 300 any range and for this particular difference or less than or greater than to be appearing here in the views when we are indexing any integers on the solar it should be decimal so we should be very careful with that it cannot be stringed there again it will appear on the top of the view so we'll move it to block so we can use this exposed form in block option to S so that it will be available as a block just placing the block on the sidebar there we go so we have this price range filters on the left side similarly we can build for operating system or any other features also can be placed before jumping on to the next slide I just want to hear from you like have you faced any problem when you are setting up the solar and indexing or have you not faced any problem at all when you are indexing and solar configuring this solar so yeah yes yeah in Drupal 8 you are adding the fields so you will make sure that whatever the fields you want to get to index it will be you are adding it so I will I will let Tanya take the stage so essentially what we did so far is we built a view and just like to show this search results and and we added some facets I I mean I understand this could have been I think this was a very fast pace that could have been slower I think we sort of messed up a bit there sorry about that I want to share this video of site building and its original speed I will be sharing the link at the end and one thing we definitely wanted to discuss was like when you try out search API module and when you install all this search API solar and facets module most of the recent versions don't work with each other out of the box so as they have been evolving what has been happening is we one version of the module works with another version of the module but when a new version comes out for search API it might not really work with the existing version of search API solar module so this is a version of modules which we found to be working when we started preparing for this so we used 8.3.1 and search API RC2 and search API solar beta 2 and facets alpha 9 although search API was actually like a day before yesterday they wrote out the first 1.0 version which I believe will be more stable than the earlier one and so when you pick the modules like watch out for the known versions of modules and and there are very high chances at least until the next few months that you would stumble into versions of modules that don't really work with each other and there are also a large number of modules in this search API ecosystem which add a lot of functionality for example this search API attachments module allows you to index the content of the PDFs or any other documents that are attached to your content for example if I had a specifications document which I attached to my phone finder, phone content type I could actually be able to search for the words that are present in the content of that attached PDF and which makes a search API and solar search even more powerful and also you might have noticed that to build that price filter we used an exposed filter to build that group would filter when we build the price facet which there are also some additional modules some of which are part of the search API pack itself and some of them are available as separate contract modules which provide more options for the UI for your facets like sliders and date range selectors etc so search API is a big ecosystem and it has a large number of modules around it and whenever you need something very specific and very customized do check out if there are any modules available that make it available out of the box and also autocomplete, multilingual and spell check aren't really working at this point of time with the versions of search API that we used although I think I believe it might have improved with the latest rollout but again like these I think should be far more stable in a few months and yeah we'll be closing about there wanted to showcase one small work we did a few months ago this was more on D7 it was more about module development than site building the module available on d.o which provides this language fallback capability so when you had a multilingual site and when you search for something and if you wanted the search to happen on the current language of the user and if a result is not found but it's available on a different language content you would actually show the current language result first and then show the default language only if there is nothing in the current language so this is a simple module you could try that out although it's on it works with D7 not D8 and also Apache Solar module not with search API and the videos that I showed you they're available over here you could bid.ly slash beyond solar b-e-y-o-n-d-s-o-l-r four videos over there and let me make that larger I'm not able to edit that so b-e-y-o-n-d-s-o-l-r bid.ly slash you could check out the videos and probably like at a better space and any specific questions? this may be more of a solar thing but in setting up searches that operate really well over multiple terms I found that the or choice gives way too broad of a set of results the and choice gives way too narrow a set of results is there something that's smart look kind of like Google search that's sort of in between where it gets as many as it can but it I think the best way to optimize that would be through the weights that you give to various fields and although I think that's not totally related to and or or but it's I've tried doing it with a solar parameter yeah I agree it's not very parameter setting it equal to two but that sort of helps but it's I was hoping there was something in that would really help that situation I don't think there's anything that exists right now that sort of like it's as smart as Google at least for solar on the counter space thank you everyone thanks for coming and have a great camp