Skip to Content

Drupal

KnackForge: Configure SOLR for Spatial Search Setup

Planet Drupal - 18 August 2015 - 10:18pm
Configure SOLR for Spatial Search Setup ----------------------------------------------------   One of our projects requires the spatial search to find the closest records for given address OR zipcodes. So we decided to use SOLR for performing spaital search based on latitude & longitude for getting the closest records.   This blog describes on SOLR configuration for location based spatial search and how to run queries on SOLR.   You can download latest SOLR from here : http://apache.mesi.com.ar/lucene/solr/   Schema Changes :   To add location data (latitude, longitude) in documents, we need to update the schema.xml file. We need to add a new field type (specifically used for geospatial searching). In case it's not already present (depends on SOLR version), we have to add the below fieldType definition to the schema.xml file.   <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>   FieldType definition is done. Now we need to define the fields for location data.   <field name="latlon" type="location" indexed="true"  stored="true" />   indexed=true makes a field searchable (and sortable and facetable). For eg, if you have a field named test1 with indexed=true, then you can search it like q=test1:foo, where foo is the value you are searching for.   stored=true means you can retrieve the field when you search.   Indexing Location Data  
Categories: Drupal

Modules Unraveled: 145 Project Workflow and Drupal Issue Queues with Joshua Mitchell - Modules Unraveled Podcast

Planet Drupal - 18 August 2015 - 10:00pm
Published: Wed, 08/19/15Download this episodeDrupal.org
  • Prioritizing work on Drupal.org Drupal.org Roadmap
    • Unblock Drupal 8
      • DrupalCI - testing infrastruture for Drupal code
      • Localize.drupal.org upgrade to D7
    • Improve search
    • Implement new documentation section and tools
  • Two Factor Authentication
  • Issue Credits
  • Funding work
    • D8Accelerate
    • Ongoing Funding
Work that is coming later Questions from Twitter
  • hussainweb
    I think a hierarchical menu system has it's place - Gives a continuity and mark progress if you want to read a topic. #MUP145
  • hussainweb
    Can you attribute different patches in a single issue - some to the organization and some as a volunteer? #MUP145
  • hussainweb
    Some issues get abandoned after some work. Is that never counted? #MUP145
  • Paulius Pazdrazdys
    How much Drupal.org forums are being used? Maby you are thinking to more question -> answer model as stackoverflow has? #MUP145 (Issue about the subject - Petition to move forums to Stack Exchange)
Episode Links: Josh on drupal.orgJosh on TwitterTags: drupal.orgplanet-drupal
Categories: Drupal

Colan Schwartz: Get search results for compound words not in content with Drupal, Search API and Solr

Planet Drupal - 18 August 2015 - 4:01pm
Topics: 

It is possible to expand compound search terms to multi-term synonyms. That is, if your Drupal site content contains text such as "dark room" or "key note", and you don't want your users to get No results pages on searches for "darkroom" or "keynote" (respectively), you'll need to do a bit of extra work to make this happen.

Let's assume we've got a Drupal 7 site working alongside Solr to provide the advanced back-end search functionality, and the Search API plus Search API Solr Search modules to integrate the two systems. At the time of this writing, this is a widely used best-practice approach. However, it doesn't natively support the above use case.

Some potential options for setting this up include spellchecking and fuzzy searching. But Solr itself already supports the use of synonyms even though the Search API does not. So let's tweak Search API's set-up to work with it.

There are several steps required to make this happen.
  1. If you're got the tokenizer enabled on your search index, disable it by unchecking the box over at Administration » Configuration » Search and metadata » Search API » Your index name » Filters » Processors » Tokenizer, and then save the configuration. If the Tokenizer option is enabled, it will prevent the synonym functionality from kicking in.
  2. Modify the Solr configuration in your search collection over at /path/to/solr/collection-name/conf/schema.xml around line 162.
    • Before:         <!-- in this example, we will only use synonyms at query time
              <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
              -->
    • After:         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  3. Define multi-term synonyms in the synonyms.txt file that's in the same folder as the above schema.xml file. Follow the form here.
    • darkroom => dark room
    • keynote => key note
  4. Restart the search engine. This is system dependent, but if you're using the GlassFish application server for example, you may be able to restart Solr with a command like sudo service GlassFish_solr restart.
  5. Clear the search index and rebuild it.
    1. Surf to Administration » Configuration » Search and metadata » Search API » Your index name.
    2. Hit the "Queue all items for reindexing" button.
    3. Hit the "Index now" button.

That should do it. You're all set!

Background reading For more information on how all of this really works, here are some useful articles on the subject.

This article, Get search results for compound words not in content with Drupal, Search API and Solr, appeared first on the Colan Schwartz Consulting Services blog.

Categories: Drupal

Shitiz Gag's Blog: [GSoC 2015: Hawk Authentication] Week 13: Final weeks

Planet Drupal - 18 August 2015 - 11:21am

GSoC is coming to a close, so these few weeks have been mostly about wrapping things up. This is good for me as well because college has taken a toll so I have less and less time to spend, but I believe I have enough to have the module at a good position before GSoC closes.

WWW-Authenticate

WWW-Authenticate is a HTTP header which is used to identify which protocols the server supports. If a server supports multiple WWW-Authenticate headers, it can send it multiple times to identify different protocols. For example: Drupal can send WWW-Authenticate: Hawk and WWW-Authenticate: Basic for identifying that it supports Hawk and Basic Auth. However, Drupal at the moment doesn’t have support for gathering and sending multiple header values from different modules due to the way it handles 401 Authentication Required exception. I will be working on allowing multiple protocols to send WWW-Authenticate so that multiple auth protocols can be identified at the same time.

Testing Hawk and Basic Auth together

I also spent a considerable amount testing these two protocols together, here is a summary of my findings but in summary: Both protocols work well individually but if a client sends requests containing both protocol’s headers at the same time it would cause either to fail due to the way HTTP protocol dictates concatenation of header values. HTTP recommends allowing only a single protocol in one request in order to have fewer points of failure so for the moment I believe this behaviour is fine, however if it is deemed beneficial to allow multiple protocols within same request it is always a possibility.

For now that is all, I’ll be dealing with WWW-Authenticate issue and documentation during my last week of GSoC.

Thank you for reading!

Categories: Drupal

Drupal for Government: Virginia Physician API and Data Mining

Planet Drupal - 18 August 2015 - 9:54am

So recently we discovered http://data.virginia.gov/hhr and since we're looking to help people in Charlottesville I've added the data (thanks to feeds) and we added a couple of data mining points  https://www.cvillecouncil.us/va-physicians (using open layers)for the maps and h

Categories: Drupal

benamer: Check out the Chartbeat Most Popular module

Planet Drupal - 18 August 2015 - 9:30am

You know those lists on a web site that you see from time to time listing the currently Most Popular articles on the site? I have to admit that I click on them from time to time to understand what is popular and why. It's a clear case of herd reading. Well, Drupal has a new module to create a Most Popular list on your site based on the Chartbeat Analytics API and it's written by myself and Darryl Norris. It's available on Drupal.org. 

Categories: Drupal

Mediacurrent: Accessible Names - Label All the Things! (Part 1)

Planet Drupal - 18 August 2015 - 8:24am

The more we label things when building a website, the easier it is for a person who is blind and uses a screen reader to use our sites. These labels are known as the “accessible name properties” and they are baked into HTML.  

Categories: Drupal

Chromatic: How To Write A Great Commit Message

Planet Drupal - 18 August 2015 - 7:02am
So annoying. Fixed a bug! Hope I never see this again.

These are not great commit messages; in fact, they are nearly worthless. A great commit message should tell the reader all they need to know about the what of the commit. They should only have to look at the actual diff of the commit to see how it was accomplished.

Anatomy of a Great Commit Message

Think of a commit message like an email:

  • It contains your contact information. You don't even have to do anything; you get this for free!
  • It should have a subject: the shorter, one-line summary.
  • A body: the detailed description.

All commit messages should abide by the following criteria:

  • Begin with a one line summary. It should be capitalized and succinct (50 chars or less).
  • This should be followed by a longer description, if necessary.
  • The first two items should be separated by an empty line.
  • All lines should be wrapped at approximately 72 characters.
  • Reference an issue in your commits whenever possible. If using Github issues, you can reference them by using 'gh-80' for issue '#80'. If your commit completes the issue, you can use a number of terms to close the issue, such as: .Closes gh-80'.
  • If you forget to reference the issue in your commit, and the commit has already been pushed, reference the commit's hash in a comment on the ticket.

Here is a model Git commit message:

Capitalized, short (50 chars or less) summary. More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Further paragraphs come after blank lines. * Bullet points are okay, too. * Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here. * Use a hanging indent. Closes gh-80.

The majority of your commit messages may be much simpler than the example above, but pick and choose the appropriate elements. Here is an example more common to the real world:

Fix for editor dashboard showing incorrect date. * Fixed date calculation logic. * Added function docblock to comply with coding standards. * Refactored foreach loop, improving clarity. Closes gh-80.

With just a few small improvements to your commit messages, your fellow developers, and your future self will surely thank you!

Categories: Drupal

Drupal.org Featured Case Studies: AL DÍA News

Planet Drupal - 18 August 2015 - 6:21am
Completed Drupal site or project URL: http://aldianews.com

ALDÍANews.com is a national news outlet offering fully bilingual content, equally accessible in both English and Spanish at the click of a toggle. The new site - which publishes news related to politics, business, culture, opinion, media, and technology - allows readers to quickly and easily choose the language in which they want to view a comprehensive array of content and features optimized for various devices through responsive design.

After evaluating AL DÍA’s content and traffic, we uncovered the untapped potential for a larger audience and advertising stream by repositioning this local news site as a national news platform. The new site implements a number of innovative elements that benefit viewers and advertisers alike, including lightning-fast browsing using AngularJS, a fully bilingual interface, and advertising that can be served to specific sections, topics, or geographies.

Key modules/theme/distribution used: ServicesSimpleAdsTaxonomy menuViewsRadioactivityOrganizations involved: Eastern Standard
Categories: Drupal

Red Crackle: Object Oriented PHP

Planet Drupal - 18 August 2015 - 4:23am
I am sure that by now you must have heard that Drupal 8 is using Symfony components and is based on object-oriented programming in PHP. If you are a Drupal 7 developer, then you may not know what is object-oriented programming or fail to understand the benefits it offers. In this series of posts, you will learn the basics of object-oriented PHP programming so that you can start developing for Drupal 8.
Categories: Drupal

Flush Facebook Cache

New Drupal Modules - 17 August 2015 - 8:25pm
Categories: Drupal

DrupalCon News: Training Spotlight: Frontend Performance Training

Planet Drupal - 17 August 2015 - 2:20pm

Mobile device usage is surging as people use them to read content, shop online, and find information on the go. Users are proven to be happier and more willing to spend time and money on your site when it loads fast and responds quickly to their actions. Adding performance to the ever-growing list of project responsibilities can seem daunting, but it doesn't have to be.

In this full-day training, we will address every step in the process of improving frontend performance: auditing a site for problems, creating an effective solution, testing sites to ensure that the work was successful, and implementing automation tools that prevent regressions from creeping back into the codebase. Additionally, we will offer tools and suggestions to help your organization adopt a culture of performance, boosting its visibility in discussions and allowing your team to expose performance problems earlier in the development cycle, long before launch.

Categories: Drupal

Drupal Watchdog: Wait, $langcode? What the Heck?

Planet Drupal - 17 August 2015 - 2:00pm
Feature

Wait, $langcode? What the Heck?

If that was the most polite thought that crossed your mind when dealing with the Drupal 7 Field API, please read on.

No matter whether you build complex multilingual sites, or whether just hearing the words “Drupal” and “language” in the same sentence makes you want to hide in the darkest corner of your office, there are a few language-related notions that you really need to know to write Drupal 8 code that works properly. After all, language is an intrinsic property of textual content, and since Drupal is supposed to manage content, having to deal with language does not seem such a peregrine idea, does it?

Speaking of Content

Historically, content in Drupal is a user-friendly way to refer to nodes. However, in Drupal 8, content has a broader meaning: it refers to any entity type which stores information usually meant to be experienced in some form by a certain set of site users.

Content entities, such as nodes, comments, terms, custom blocks, custom menu links, and users, are all examples of this kind of entity type. The other main category is Configuration entities: node types, views, fields, menus, and roles, are meant to store information mainly related to determining the site behavior. Note that this distinction may not always be so clear-cut, as in some cases the choice of picking one category or the other may be determined mainly by implementation details, as in the case of module-provided menu links.

To sum up, when in Drupal 8 we speak of content, most of the time we are referring to content entity types.

Multilingual Content: A Bit of History

In Drupal 7, a new way of translating content was introduced by adding native multilingual support to the Field API. That allowed the ability to store multilingual values for any field attached to any entity type. But code that implements business logic needs to explicitly deal with field language, which implies a very poor developer experience (DX); i.e., this infamous field data structure:

Categories: Drupal

Red Crackle: Configure PHPStorm to debug Drupal 8

Planet Drupal - 17 August 2015 - 12:30pm
Devel module provides dsm() and dpm() functions to output variables on the page for debugging Drupal. But if the problem is more complicated, then that's not sufficient. You can simplify debugging tremendously if you stop code execution using breakpoints and then execute the application one step at a time. All IDEs that support PHP debugging, such as Eclipse, Netbeans, PHPStorm, etc., provide the functionality to put breakpoints in the code. But it requires quite a bit of configuration to make it work. In this post, you will learn how to configure PHPStorm 9 to debug Drupal 8. By the end of this article, you will be able to stop code execution in PHPStorm by putting a breakpoint.
Categories: Drupal

Four Kitchens: Rest Easy Part 3: Now Filter This

Planet Drupal - 17 August 2015 - 9:45am

In the third installment of REST Easy, our RESTful module tutorial series, we’ll take a look at how to filter your API endpoints for results, a great feature that brings in the power of Entity Field Query for your APIs.

Categories: Drupal

SitePoint PHP Drupal: From Request to Response: A Journey into Drupal 8 Internals

Planet Drupal - 17 August 2015 - 9:00am

In the first article on Drupal 8 module development we looked a bit at the routing aspect of this process. We’ve seen that creating pages with paths is now a matter of declaring routes that match up with controllers. The latter, as we’ve seen, can return a render array that gets interpreted into markup and displayed in the main content area of that page. However, did you know that under the hood, Drupal actually transforms that array into a Response object according to the dictates of Symfony’s HTTPKernelInterface?

In this article, I would like us to go deeper into the internals of Drupal 8 (and Symfony2) and look at what actually happens (and can happen) from the moment a request is made by a user to the one in which they see something returned in response. The example I mentioned above is just one direction this process can go in, and today we are also going to see other possibilities. The goal is to understand the flexibility of the system which in turn can help us build awesome applications.

Before going into it, I strongly recommend you check out this diagram which does an amazing job at synthesizing what is often referred to as the render pipeline. Though in my opinion it represents more than the name implies because the render system is only part of what’s depicted, albeit a big one.

Continue reading %From Request to Response: A Journey into Drupal 8 Internals%

Categories: Drupal

Node type class

New Drupal Modules - 17 August 2015 - 5:43am

This module is used to add class to the nodes based on the content type.

Configuration:

Once the module is enabled:

1. This module adds a fieldset named "Node type class" in node type form,
For eg: admin/structure/types/manage/article for "article" content type.

2. It adds the class(es) to the <body> tag of the node page.

Related Module:

Node class: This module adds class per node not per content type.

Categories: Drupal

Annertech: 6 Reasons Why We Suggest Drupal to Our Clients

Planet Drupal - 17 August 2015 - 3:36am
6 Reasons Why We Suggest Drupal to Our Clients

We recommend using Drupal as a content management system platform for our client projects for many reasons, not least of which is that it is a widely adopted, free, open source solution. Here are some of the strengths that we see our clients benefiting from when they use the Drupal content management system.

Categories: Drupal

Jim Birch: Using Fences and Page Manager to optimize HTML markup in Drupal 7

Planet Drupal - 17 August 2015 - 2:20am

I have been searching for a way to make Drupal output cleaner, lighter, more semantic HTML since I started theming.  We all know Drupal core, and it's many contrib modules have a tendency to inject a couple-two-tree divs in 'dere.  I have tried many different ways, much to the chagrin of the developers I have worked with, most of them probably not worth the effort I put in.  That is until now!

The goal of my approach here is to minimize the markup that Drupal puts out, and gain complete control over the what and the where of the markup.  I can gain control of the fields using the Fences module; control over the templates in my theme; and gain even more control over the placement and what gets loaded using ctools Page Manager and Panels.  I will step through each of this in detail below.

Read more

Categories: Drupal
Syndicate content


Google+
about seo