In the following videos, we'll be installing modules to perform various search functions. So, in this video, we will create a content type for Items that are for sale. It will have fields for item name, location of the item, file attachments and price so that we can search based on those fields. And since it will contain location field, let's first install and enable the modules we need to provide a field type for storing geolocation data.

Install module

Enable module

  • Go to "Modules" (admin/modules) and enable:
    • GeoPHP
    • Geofield
    • Geocoder
  • (Save Configuration)

Let's create a new the content type

  • Go to "Structure => Content types => Add content type" (admin/structure/types/add)
  • Name: Item
  • Description: An item for sale.
  • Submission form settings
    • Title field label: Item name
  • (Save and add fields)

Add new field:

  • Label: Item location
  • Field type: Text
  • Widget: Text Field
  • (Save)
  • (Save field settings)
  • (Save settings)

Add new field:

  • Label: Location (This field won't be visible to the user. It is just used to geocode the information entered by the user in the last field.)
  • Field type: Geofield
  • Widget: Geocode from another field
  • (Save)
  • (Save field settings)
  • Item Settings
    • Geocode from field: Item location
  • (Save settings)

Add new field:

  • Label: File attachments
  • Field type: File
  • Widget: File
  • (Save)
  • (Save field settings)
  • Item Settings
    • Allowed file extensions: txt, pdf, doc
  • (Save settings)

Add new field:

  • Label: Price
  • Field type: Decimal
  • Widget: Text Field
  • (Save)
  • (Save field settings)
  • Item Settings
    • Minimum: 0
    • Maximum: 100000
    • Prefix: $
  • (Save settings)

Let's create some content.

Create Content

  • Go to "Content => Add content => Item" (node/add/item)
  • Item name: Item #1
    • Body: (Lorem Ipsum)
    • Item location: Manila, Philippines
    • Attachment: file #1 (I will attach a text file with the content "Monday to Friday 8:00 am to 5:00 pm".)
    • Price: 10.00
    • (Save)
  • Item name: Item #2
    • Body: (Lorem Ipsum)
    • Item location: Paris France
    • Attachment: file #2
    • Price: 20.00
    • (Save)
  • Item name: Item #3
    • Body: (Lorem Ipsum)
    • Location: Wichita, KS
    • Attachment: file #2
    • Price: 30.00
    • (Save)

Now that we've created content with these fields, the following videos will be able to perform search actions on these fields. In the next video, we'll be adding autocomplete functionality to out search.